Hi Miklos,

On 26/11/2026 22:47, Miklos Szeredi wrote:
> generic_shutdown_super() clears SB_ACTIVE before calling evict_inodes(),
> so at unmount time fuse_evict_inode() skipped fuse_vdax_inode_cleanup()
> for every remaining inode.  The DAX ranges owned by those inodes stay on
> fc->vdax->busy_ranges instead of being returned to the free pool, and
> fuse_vdax_conn_free() only frees free_ranges before kfree()ing the
> connection, so the busy fuse_dax_mapping objects are leaked.  Nothing
> warns about it: fuse_free_inode() kfree()s fi->vdax without checking
> that the interval tree is empty.
> 
> Call fuse_vdax_inode_cleanup() regardless of SB_ACTIVE.  That is what
> virtio_fs_conn_destroy() has always assumed ("Soon evict_inodes() will
> be called which will free all memory ranges belonging to all inodes").
> Unlike the FORGET in the same block, which is pointless once DESTROY has
> been sent, the DAX cleanup is the only thing there that owns memory.
> 

Minor nit: should we consider adding 
"WARN_ON(!list_empty(&fc->vdax->busy_ranges));" 
in fuse_vdax_conn_free()? Since as you noted, 
fuse_vdax_conn_free() only frees free_ranges.

Reviewed-by: Li Wang <[email protected]>

Thanks,
Li Wang

Reply via email to