Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Nov 2020 12:31:21 +0000
From:      "kib (Konstantin Belousov)" <phabric-noreply@FreeBSD.org>
To:        Phabricator <phabric-noreply@FreeBSD.org>
Cc:        dev-reviews@freebsd.org
Subject:   [Differential] D27269: msdosfs: suspend around umount or remount rw->ro.
Message-ID:  <26d739c98b017b6d91051748fd05b2a6@localhost.localdomain>
In-Reply-To: <differential-rev-PHID-DREV-xxqiq4h3xjr2zd4oi77p-req@reviews.freebsd.org>
References:  <differential-rev-PHID-DREV-xxqiq4h3xjr2zd4oi77p-req@reviews.freebsd.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
kib marked an inline comment as done.
Closed by commit rS367890: msdosfs: Add trivial support for suspension. (authored by kib).

CHANGED PRIOR TO COMMIT
  https://reviews.freebsd.org/D27269?vs=79749&id=79797#toc

REPOSITORY
  rS FreeBSD src repository

CHANGES SINCE LAST UPDATE
  https://reviews.freebsd.org/D27269?vs=79749&id=79797

CHANGES SINCE LAST ACTION
  https://reviews.freebsd.org/D27269/new/

REVISION DETAIL
  https://reviews.freebsd.org/D27269

AFFECTED FILES
  head/sys/fs/msdosfs/msdosfs_vfsops.c
  head/sys/fs/msdosfs/msdosfs_vnops.c

EMAIL PREFERENCES
  https://reviews.freebsd.org/settings/panel/emailpreferences/

To: kib, mckusick
Cc: pho, imp, dev-reviews

[-- Attachment #2 --]
diff --git a/head/sys/fs/msdosfs/msdosfs_vnops.c b/head/sys/fs/msdosfs/msdosfs_vnops.c
--- a/head/sys/fs/msdosfs/msdosfs_vnops.c
+++ b/head/sys/fs/msdosfs/msdosfs_vnops.c
@@ -848,7 +848,7 @@
 	* Non-critical metadata for associated directory entries only
 	* gets synced accidentally, as in most file systems.
 	*/
-	if (ap->a_waitfor == MNT_WAIT) {
+	if (ap->a_waitfor != MNT_NOWAIT) {
 		devvp = VTODE(ap->a_vp)->de_pmp->pm_devvp;
 		vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY);
 		allerror = VOP_FSYNC(devvp, MNT_WAIT, ap->a_td);
@@ -856,7 +856,7 @@
 	} else
 		allerror = 0;
 
-	error = deupdat(VTODE(ap->a_vp), ap->a_waitfor == MNT_WAIT);
+	error = deupdat(VTODE(ap->a_vp), ap->a_waitfor != MNT_NOWAIT);
 	if (allerror == 0)
 		allerror = error;
 	return (allerror);
diff --git a/head/sys/fs/msdosfs/msdosfs_vfsops.c b/head/sys/fs/msdosfs/msdosfs_vfsops.c
--- a/head/sys/fs/msdosfs/msdosfs_vfsops.c
+++ b/head/sys/fs/msdosfs/msdosfs_vfsops.c
@@ -950,6 +950,12 @@
 	error = msdosfs_fsiflush(pmp, waitfor);
 	if (error != 0)
 		allerror = error;
+
+	if (allerror == 0 && waitfor == MNT_SUSPEND) {
+		MNT_ILOCK(mp);
+		mp->mnt_kern_flag |= MNTK_SUSPEND2 | MNTK_SUSPENDED;
+		MNT_IUNLOCK(mp);
+	}
 	return (allerror);
 }
 

help

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