Re: [PATCH] ceph: fix leaked inode reference on writeback abort at umount

From: Xiubo Li

Date: Wed Aug 12 2026 - 09:09:43 EST


> Only the locked_pages loop is changed here. The preceding fbatch loop is > deliberately left alone...

The refcounting analysis and the fix look correct to me. In
particular, the claim needs to be dropped before
redirty_page_for_writepage(), otherwise ceph_dirty_folio() can observe
an already-claimed folio and create an extra wrbuffer reference
without taking another inode reference.

One thing I'd like to clarify is why the locked_pages entries are
guaranteed to own the claim being undone, while the entries handled
through fbatch may still belong to another in-flight write. This seems
to be the key distinction for why ceph_process_folio_batch() is
intentionally left unchanged. Assuming that ownership distinction is
guaranteed by the locking/state transitions, the fix looks good to me.

Thanks
Xiubo Li