[DragonFlyBSD - Bug #3464] (New) ext2fs: umount hangs and panics after a device write error or hot-unplug
sigttou
bugtracker-admin at leaf.dragonflybsd.org
Sun Nov 8 07:25:56 PST 2026
Issue #3464 has been reported by sigttou.
----------------------------------------
Bug #3464: ext2fs: umount hangs and panics after a device write error or hot-unplug
http://bugs.dragonflybsd.org/issues/3464
* Author: sigttou
* Status: New
* Priority: Normal
* Target version: 6.6
* Start date: 2026-11-08
----------------------------------------
Four patches for ext2fs error handling when a device fails or a mount
update cannot write the clean flag. They are one series, in this order:
0004 builds on 0003 (same function, @ext2_mount()@ MNT_UPDATE paths) and
does not apply without it.
0001 @ext2_fsync()@ looped over the dirty buffers of a vnode until the scan
was empty. When a write fails because the device is gone, the buffer is
re-dirtied, so umount(2) never returns and the thread spins in the kernel.
It now uses @vfsync()@ and returns the write error, as UFS does.
0002 Unmount could run @ext2_sync()@ with a non-blocking scan, skip a locked
vnode and then reclaim it with dirty buffers attached; nothing writes
them and the buffer daemon retries forever. @ext2_flushfiles()@ now syncs
with a blocking scan first and refuses the unmount on error. This is
stricter than FFS: @umount -f@ can no longer discard data that keeps
failing to write.
0003 @ext2_mount()@ ignored the @ext2_flushfiles()@ error on a read-write to
read-only downgrade and left the mount flagged read-write while the
in-core superblock said read-only ("ext2_sync: rofs mod" panic on the
next unmount in the control run). The error is returned before
@e2fs_ronly@ is set, as FFS does.
0004 The downgrade and upgrade paths ignored errors of @ext2_cgupdate()@ and
@ext2_sbupdate()@: a failed clean-flag write returned success, and an
upgrade whose superblock write failed mounted read-write with the clean
flag still set on disk. They now return the error and restore the saved
state.
---Files--------------------------------
0001-ext2fs-use-vfsync-in-ext2_fsync-so-a-failed-write-is.patch (3.36 KB)
0002-ext2fs-sync-with-a-blocking-scan-before-vflush-on-un.patch (4.34 KB)
0003-ext2fs-fail-a-rw-to-ro-downgrade-when-flushing-files.patch (1.47 KB)
0004-ext2fs-fail-a-mount-update-whose-clean-flag-write-fa.patch (3.36 KB)
--
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account
More information about the Bugs
mailing list