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,
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to