summaryrefslogtreecommitdiffstats
path: root/sys/fs/tmpfs
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2014-07-16 14:04:46 +0000
committerkib <kib@FreeBSD.org>2014-07-16 14:04:46 +0000
commit32a7383c85234a8aacc33c0415ab10beec2e0da3 (patch)
treed402822e2dc2ab92fb22d185c4e7be6a3d01ed96 /sys/fs/tmpfs
parent508ee54556732e7fb194230700780b603987b02a (diff)
downloadFreeBSD-src-32a7383c85234a8aacc33c0415ab10beec2e0da3.zip
FreeBSD-src-32a7383c85234a8aacc33c0415ab10beec2e0da3.tar.gz
Check for the cross-device cross-link attempt in the VFS, instead of
forcing filesystem VOP_LINK() methods to repeat the code. In tmpfs_link(), remove redundand check for the type of the source, already done by VFS. Note that NFS server already performs this check before calling VOP_LINK(). Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
Diffstat (limited to 'sys/fs/tmpfs')
-rw-r--r--sys/fs/tmpfs/tmpfs_vnops.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c
index cb35a69..c11fe31 100644
--- a/sys/fs/tmpfs/tmpfs_vnops.c
+++ b/sys/fs/tmpfs/tmpfs_vnops.c
@@ -571,21 +571,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