Page MenuHomeFreeBSD

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

Authored by kib on Nov 18 2020, 2:43 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 19, 10:38 AM
Unknown Object (File)
Thu, Nov 14, 5:50 AM
Unknown Object (File)
Oct 2 2024, 5:08 PM
Unknown Object (File)
Sep 28 2024, 7:56 AM
Unknown Object (File)
Sep 27 2024, 1:22 AM
Unknown Object (File)
Sep 24 2024, 10:07 AM
Unknown Object (File)
Sep 10 2024, 3:20 PM
Unknown Object (File)
Sep 5 2024, 3:28 PM
Subscribers

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 - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 34927

Event Timeline

kib requested review of this revision.Nov 18 2020, 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

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.Nov 19 2020, 5:34 PM
kib added inline comments.
sys/fs/msdosfs/msdosfs_vfsops.c
822

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.Nov 20 2020, 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.Nov 20 2020, 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).