]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
fuse: clean up device cloning
authorMiklos Szeredi <mszeredi@redhat.com>
Thu, 12 Mar 2026 11:19:10 +0000 (12:19 +0100)
committerMiklos Szeredi <mszeredi@redhat.com>
Thu, 2 Apr 2026 18:52:59 +0000 (20:52 +0200)
commit4ae404afd92e36be378eb120a2dc13031cdac7a6
treed5a4f56cf4656960d795bcfb9b0b99aafda50171
parentd42eb23b2ef9fbe66ea7fd4b3153c3244818d47c
fuse: clean up device cloning

 - fuse_mutex is not needed for device cloning, because fuse_dev_install()
   uses cmpxcg() to set fud->fc, which prevents races between clone/mount
   or clone/clone.  This makes the logic simpler

 - Drop fc->dev_count.  This is only used to check in release if the device
   is the last clone, but checking list_empty(&fc->devices) is equivalent
   after removing the released device from the list.  Removing the fuse_dev
   before calling fuse_abort_conn() is okay, since the processing and io
   lists are now empty for this device.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/dev.c
fs/fuse/fuse_i.h
fs/fuse/inode.c