Author: kp
Date: Fri Oct 11 17:04:38 2019
New Revision: 353443
URL: https://svnweb.freebsd.org/changeset/base/353443

Log:
  mountroot: run statfs after mounting devfs
  
  The usual flow for mounting a file system is to VFS_MOUNT() and then
  immediately VFS_STATFS().
  
  That's not done in vfs_mountroot_devfs(), which means the
  mp->mnt_stat.f_iosize field is not correctly populated, which in turn
  causes us to mark valid aio operations as unsafe (because the io size is
  set to 0), ultimately causing the aio_test:md_waitcomplete test to fail.
  
  Reviewed by:  mckusick
  MFC after:    1 week
  Sponsored by: Axiado
  Differential Revision:        https://reviews.freebsd.org/D21897

Modified:
  head/sys/kern/vfs_mountroot.c

Modified: head/sys/kern/vfs_mountroot.c
==============================================================================
--- head/sys/kern/vfs_mountroot.c       Fri Oct 11 17:01:02 2019        
(r353442)
+++ head/sys/kern/vfs_mountroot.c       Fri Oct 11 17:04:38 2019        
(r353443)
@@ -263,6 +263,11 @@ vfs_mountroot_devfs(struct thread *td, struct mount **
                if (error)
                        return (error);
 
+               error = VFS_STATFS(mp, &mp->mnt_stat);
+               KASSERT(error == 0, ("VFS_STATFS(devfs) failed %d", error));
+               if (error)
+                       return (error);
+
                opts = malloc(sizeof(struct vfsoptlist), M_MOUNT, M_WAITOK);
                TAILQ_INIT(opts);
                mp->mnt_opt = opts;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to