summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2014-07-30 03:56:17 +0000
committerkib <kib@FreeBSD.org>2014-07-30 03:56:17 +0000
commit4af1d57b25130479d52f78618815e22d50cff4d8 (patch)
treeda99d07701f732cb9a7ea1f978fc1e8a5724dfe9 /sys/fs
parent7c889ea487454b0962d2e64bd3110b9549a88afa (diff)
downloadFreeBSD-src-4af1d57b25130479d52f78618815e22d50cff4d8.zip
FreeBSD-src-4af1d57b25130479d52f78618815e22d50cff4d8.tar.gz
MFC r268764:
Check for the cross-device cross-link attempt in the VFS, instead of VOP_LINK() implemenations.
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/ext2fs/ext2_vnops.c4
-rw-r--r--sys/fs/nandfs/nandfs_vnops.c3
-rw-r--r--sys/fs/nfsclient/nfs_clvnops.c4
-rw-r--r--sys/fs/nullfs/null_vnops.c10
-rw-r--r--sys/fs/tmpfs/tmpfs_vnops.c15
5 files changed, 0 insertions, 36 deletions
diff --git a/sys/fs/ext2fs/ext2_vnops.c b/sys/fs/ext2fs/ext2_vnops.c
index 523e3c7..2046e33 100644
--- a/sys/fs/ext2fs/ext2_vnops.c
+++ b/sys/fs/ext2fs/ext2_vnops.c
@@ -666,10 +666,6 @@ ext2_link(struct vop_link_args *ap)
if ((cnp->cn_flags & HASBUF) == 0)
panic("ext2_link: no name");
#endif
- if (tdvp->v_mount != vp->v_mount) {
- error = EXDEV;
- goto out;
- }
ip = VTOI(vp);
if ((nlink_t)ip->i_nlink >= EXT2_LINK_MAX) {
error = EMLINK;
diff --git a/sys/fs/nandfs/nandfs_vnops.c b/sys/fs/nandfs/nandfs_vnops.c
index 056ca90..0f26b19 100644
--- a/sys/fs/nandfs/nandfs_vnops.c
+++ b/sys/fs/nandfs/nandfs_vnops.c
@@ -1355,9 +1355,6 @@ nandfs_link(struct vop_link_args *ap)
struct nandfs_inode *inode = &node->nn_inode;
int error;
- if (tdvp->v_mount != vp->v_mount)
- return (EXDEV);
-
if (inode->i_links_count >= LINK_MAX)
return (EMLINK);
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c
index 83b48b4..c24d58b 100644
--- a/sys/fs/nfsclient/nfs_clvnops.c
+++ b/sys/fs/nfsclient/nfs_clvnops.c
@@ -1977,10 +1977,6 @@ nfs_link(struct vop_link_args *ap)
struct nfsvattr nfsva, dnfsva;
int error = 0, attrflag, dattrflag;
- if (vp->v_mount != tdvp->v_mount) {
- return (EXDEV);
- }
-
/*
* Push all writes to the server, so that the attribute cache
* doesn't get "out of sync" with the server.
diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c
index 95113a8..b8b9e0d 100644
--- a/sys/fs/nullfs/null_vnops.c
+++ b/sys/fs/nullfs/null_vnops.c
@@ -858,15 +858,6 @@ null_vptocnp(struct vop_vptocnp_args *ap)
return (error);
}
-static int
-null_link(struct vop_link_args *ap)
-{
-
- if (ap->a_tdvp->v_mount != ap->a_vp->v_mount)
- return (EXDEV);
- return (null_bypass((struct vop_generic_args *)ap));
-}
-
/*
* Global vfs data structures
*/
@@ -880,7 +871,6 @@ struct vop_vector null_vnodeops = {
.vop_getwritemount = null_getwritemount,
.vop_inactive = null_inactive,
.vop_islocked = vop_stdislocked,
- .vop_link = null_link,
.vop_lock1 = null_lock,
.vop_lookup = null_lookup,
.vop_open = null_open,
diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c
index 23bb3c5..e656f2c 100644
--- a/sys/fs/tmpfs/tmpfs_vnops.c
+++ b/sys/fs/tmpfs/tmpfs_vnops.c
@@ -573,21 +573,6 @@ tmpfs_link(struct vop_link_args *v)
MPASS(VOP_ISLOCKED(dvp));
MPASS(cnp->cn_flags & HASBUF);
MPASS(dvp != vp); /* XXX When can this be false? */
-
- /* XXX: Why aren't the following two tests done by the caller? */
-
- /* Hard links of directories are forbidden. */
- if (vp->v_type == VDIR) {
- error = EPERM;
- goto out;
- }
-
- /* Cannot create cross-device links. */
- if (dvp->v_mount != vp->v_mount) {
- error = EXDEV;
- goto out;
- }
-
node = VP_TO_TMPFS_NODE(vp);
/* Ensure that we do not overflow the maximum number of links imposed
OpenPOWER on IntegriCloud