[PATCH 0/2] ceph: dirty folios left at umount

From: Xiubo Li via B4 Relay

Date: Sun Nov 08 2026 - 19:27:47 EST


Two fixes for dirty folios that umount waits for until mount_timeout,
and that can leave the inode busy, which BUGs in generic_shutdown_super().

Patch 1 takes a folio out of mdsc->dirty_folios wherever it stops being
dirty: ceph_invalidate_folio() and write_folio_nounlock() only put its
snap context and Fb cap ref, so after e.g. a truncate of dirty data
umount waits for the folio until mount_timeout.

Patch 2 drops the dirty folios of an inode when the mount is shut down
and they can no longer be written back. When the client was evicted,
the caps went before the forced umount, so nothing invalidated the
folios; they kept their Fb cap ref, and with it the inode:

ceph: ... umount timed out, 0
VFS: Busy inodes after unmount of ceph (ceph)
kernel BUG at fs/super.c:731!

Tested with the qa lazy I/O suite (the evicted writer case hit the BUG
on the first run without the fixes, and passes 5/5 with them) and with
fsstress, on a KASAN + lockdep + kmemleak kernel.

Signed-off-by: Xiubo Li <xiubo.li@xxxxxxxxx>
---
Xiubo Li (2):
ceph: count a dirty folio out wherever it stops being dirty
ceph: drop the dirty folios that a shut down mount cannot write back

fs/ceph/addr.c | 43 +++++++++++++++++++++++++++++++++----------
fs/ceph/super.c | 8 ++++++++
2 files changed, 41 insertions(+), 10 deletions(-)
---
base-commit: 5dcec86cc31f8144857c0d9bf2a7fa13b6e6f531
change-id: 20261108-ceph-shutdown-dirty-folios-fe7cf2fdb206

Best regards,
--
Xiubo Li <xiubo.li@xxxxxxxxx>