Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Aug 2020 10:31:17 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r364063 - head/sys/fs/nullfs
Message-ID:  <202008101031.07AAVHSq092503@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Mon Aug 10 10:31:17 2020
New Revision: 364063
URL: https://svnweb.freebsd.org/changeset/base/364063

Log:
  nullfs: add missing VOP_STAT handling
  
  Tested by:	pho

Modified:
  head/sys/fs/nullfs/null_vnops.c

Modified: head/sys/fs/nullfs/null_vnops.c
==============================================================================
--- head/sys/fs/nullfs/null_vnops.c	Mon Aug 10 09:03:29 2020	(r364062)
+++ head/sys/fs/nullfs/null_vnops.c	Mon Aug 10 10:31:17 2020	(r364063)
@@ -182,6 +182,7 @@
 #include <sys/namei.h>
 #include <sys/sysctl.h>
 #include <sys/vnode.h>
+#include <sys/stat.h>
 
 #include <fs/nullfs/null.h>
 
@@ -484,9 +485,21 @@ null_setattr(struct vop_setattr_args *ap)
 }
 
 /*
- *  We handle getattr only to change the fsid.
+ *  We handle stat and getattr only to change the fsid.
  */
 static int
+null_stat(struct vop_stat_args *ap)
+{
+	int error;
+
+	if ((error = null_bypass((struct vop_generic_args *)ap)) != 0)
+		return (error);
+
+	ap->a_sb->st_dev = ap->a_vp->v_mount->mnt_stat.f_fsid.val[0];
+	return (0);
+}
+
+static int
 null_getattr(struct vop_getattr_args *ap)
 {
 	int error;
@@ -918,6 +931,7 @@ struct vop_vector null_vnodeops = {
 	.vop_accessx =		null_accessx,
 	.vop_advlockpurge =	vop_stdadvlockpurge,
 	.vop_bmap =		VOP_EOPNOTSUPP,
+	.vop_stat =		null_stat,
 	.vop_getattr =		null_getattr,
 	.vop_getwritemount =	null_getwritemount,
 	.vop_inactive =		null_inactive,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008101031.07AAVHSq092503>