On Mon, Mar 03, 2025 at 12:00:29PM -0500, Josef Bacik wrote: > Hello, > > I've recently gotten annoyed with the current reference counting rules that > exist in the file system arena, specifically this pattern of having 0 > referenced objects that indicate that they're ready to be reclaimed. The other way around is worse. E.g. the xfs_buf currently holds a reference of 1 for buffers on the LRU, which makes a complete mess of the buf rele and related code. And it prevents us from using the lockref primitive. Switching it to have a refcount of zero greatly cleans this up: http://git.infradead.org/?p=users/hch/xfs.git;a=commitdiff;h=8b46634dd6199f332f09e6f730a7a8801547c8b5 I suspect the inode just needs more clear rules about what state an inode can be in.