From 4af1d57b25130479d52f78618815e22d50cff4d8 Mon Sep 17 00:00:00 2001 From: kib Date: Wed, 30 Jul 2014 03:56:17 +0000 Subject: MFC r268764: Check for the cross-device cross-link attempt in the VFS, instead of VOP_LINK() implemenations. --- sys/fs/tmpfs/tmpfs_vnops.c | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'sys/fs/tmpfs') 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 -- cgit v1.1