Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F173773210
D59910.id187454.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D59910.id187454.diff
View Options
diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c
--- a/sys/fs/nullfs/null_vnops.c
+++ b/sys/fs/nullfs/null_vnops.c
@@ -585,12 +585,19 @@
static int
null_stat(struct vop_stat_args *ap)
{
+ struct mount *mp;
+ struct null_mount *xmp;
int error;
if ((error = null_bypass(&ap->a_gen)) != 0)
return (error);
- ap->a_sb->st_dev = ap->a_vp->v_mount->mnt_stat.f_fsid.val[0];
+ mp = ap->a_vp->v_mount;
+ xmp = MOUNTTONULLMOUNT(mp);
+ ap->a_sb->st_dev = mp->mnt_stat.f_fsid.val[0];
+ if (xmp->nullm_lowerrootvp->v_type != VDIR)
+ ap->a_sb->st_bsdflags |= SFBSD_MNTROOT;
+
return (0);
}
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -2570,6 +2570,8 @@
}
error = VOP_STAT(nd.ni_vp, sbp, td->td_ucred, NOCRED);
NDFREE_PNBUF(&nd);
+ if (error == 0 && (nd.ni_vp->v_vflag & VV_ROOT) != 0)
+ sbp->st_bsdflags |= SFBSD_MNTROOT;
vput(nd.ni_vp);
#ifdef __STAT_TIME_T_EXT
sbp->st_atim_ext = 0;
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -1838,6 +1838,8 @@
vn_lock(vp, LK_SHARED | LK_RETRY);
error = VOP_STAT(vp, sb, active_cred, fp->f_cred);
+ if (error == 0 && (vp->v_vflag & VV_ROOT) != 0)
+ sb->st_bsdflags |= SFBSD_MNTROOT;
VOP_UNLOCK(vp);
return (error);
diff --git a/sys/sys/stat.h b/sys/sys/stat.h
--- a/sys/sys/stat.h
+++ b/sys/sys/stat.h
@@ -343,6 +343,7 @@
/* st_bsdflags */
#define SFBSD_NAMEDATTR 0x0001 /* file is named attribute or dir */
+#define SFBSD_MNTROOT 0x0002 /* root of the mount point */
#ifdef _KERNEL
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Sep 29, 7:27 AM (14 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39864981
Default Alt Text
D59910.id187454.diff (1 KB)
Attached To
Mode
D59910: stat(2): report mount points using st_bsdflags SFBSD_MNTPOINT flag
Attached
Detach File
Event Timeline
Log In to Comment