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)
Feb 2 2024, 9:50 AM
Unknown Object (File)
Jan 3 2024, 7:38 AM
Unknown Object (File)
Jan 3 2024, 7:35 AM
Unknown Object (File)
Dec 28 2023, 5:19 PM
Unknown Object (File)
Dec 28 2023, 12:22 AM
Unknown Object (File)
Dec 24 2023, 9:11 PM
Unknown Object (File)
Dec 23 2023, 7:42 PM
Unknown Object (File)
Dec 22 2023, 12:18 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).