Page MenuHomeFreeBSD

msdosfs: suspend around umount or remount rw->ro.
ClosedPublic

Authored by kib on Wed, Nov 18, 2:43 PM.

Details

Summary

This also eliminates unsafe use of VFS_SYNC(MNT_WAIT).

Requested by: mckusick
Tested by: pho

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

kib requested review of this revision.Wed, Nov 18, 2:43 PM

Fix bug in unmount, do not resume writes when we did not suspended them, on error.
Actually ack suspension from msdosfs_sync().

Thanks for doing this cleanup. This looks good to me, though I had a question on one detail.

sys/fs/msdosfs/msdosfs_vfsops.c
822 ↗(On Diff #79749)

Why do we need to resume writes if we're unmounting and near the end of that process? Is this a precondition for something else?

kib marked an inline comment as done.Thu, Nov 19, 5:34 PM
kib added inline comments.
sys/fs/msdosfs/msdosfs_vfsops.c
822 ↗(On Diff #79749)

Draining mount point for safe state in vfs_mount_destroy() checks that there is no active writers when mp is destroyed.

VFS guarantees that no new consumers can enter mp when VFS_UNMOUNT() is called, so this is a precaution against bugs in this area, and calls to vfs_write_resume() restore invariant that is assumed by the unmount code.

This revision was not accepted when it landed; it landed in state Needs Review.Fri, Nov 20, 12:31 PM
This revision was automatically updated to reflect the committed changes.
kib marked an inline comment as done.
kib updated this revision to Diff 79798.

Rebase

This revision was not accepted when it landed; it landed in state Needs Review.Fri, Nov 20, 3:19 PM
This revision was automatically updated to reflect the committed changes.

Belatedly, these changes look good and in particular get rid of VOP_SYNC(..., MNT_WAIT).