Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Oct 2019 03:38:02 +0000 (UTC)
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r353717 - stable/11/sys/kern
Message-ID:  <201910180338.x9I3c2rc083698@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kp
Date: Fri Oct 18 03:38:02 2019
New Revision: 353717
URL: https://svnweb.freebsd.org/changeset/base/353717

Log:
  MFC r353443
  
  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.
  
  Sponsored by:	Axiado

Modified:
  stable/11/sys/kern/vfs_mountroot.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/vfs_mountroot.c
==============================================================================
--- stable/11/sys/kern/vfs_mountroot.c	Fri Oct 18 03:38:01 2019	(r353716)
+++ stable/11/sys/kern/vfs_mountroot.c	Fri Oct 18 03:38:02 2019	(r353717)
@@ -258,6 +258,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;



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