From 0d421097a3ece111e0d4cebe2651b7a3500774c3 Mon Sep 17 00:00:00 2001 From: Tomohiro Kusumi Date: Thu, 14 May 2015 06:54:24 +0900 Subject: [PATCH] sys/vfs/tmpfs: Remove duplicated cross-device check on nlink vop - 'if (dvp->v_mount != vp->v_mount)' which avoids cross-device hard link appears twice in this function after this one. - Maybe this should be done in sys/kern/vfs_vopops.c considering fs that implement nlink have the same check (not sure if it should be applied to all fs though e.g. unionfs). # grep -rIl EXDEV sys/vfs/ sys/vfs/smbfs/smbfs_vnops.c sys/vfs/union/union_vnops.c sys/vfs/tmpfs/tmpfs_vnops.c sys/vfs/dirfs/dirfs_vnops.c sys/vfs/nfs/nfs_serv.c sys/vfs/nfs/nfs_vnops.c sys/vfs/hammer2/hammer2_vnops.c sys/vfs/puffs/puffs_vfsops.c sys/vfs/puffs/puffs_vnops.c sys/vfs/ufs/ufs_vnops.c sys/vfs/msdosfs/msdosfs_vnops.c sys/vfs/hammer/hammer_vnops.c --- sys/vfs/tmpfs/tmpfs_vnops.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/vfs/tmpfs/tmpfs_vnops.c b/sys/vfs/tmpfs/tmpfs_vnops.c index b3f9d6e4b2..86c3185103 100644 --- a/sys/vfs/tmpfs/tmpfs_vnops.c +++ b/sys/vfs/tmpfs/tmpfs_vnops.c @@ -969,8 +969,6 @@ tmpfs_nlink(struct vop_nlink_args *v) struct mount *mp; int error; - if (dvp->v_mount != vp->v_mount) - return(EXDEV); mp = dvp->v_mount; KKASSERT(dvp != vp); /* XXX When can this be false? */ -- 2.41.0