diff --git a/fs/fuse/file.c b/fs/fuse/file.c index d96daeaa807b..cb34aa80c4f8 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -359,8 +359,14 @@ void fuse_release_common(struct file *file, bool isdir) * Make the release synchronous if this is a fuseblk mount, * synchronous RELEASE is allowed (and desirable) in this case * because the server can be trusted not to screw up. + * + * Always use the asynchronous file put because the current thread + * might be the fuse server. This can happen if a process starts some + * aio and closes the fd before the aio completes. Since aio takes its + * own ref to the file, the IO completion has to drop the ref, which is + * how the fuse server can end up closing its clients' files. */ - fuse_file_put(ra->inode, ff, ff->fm->fc->destroy, isdir); + fuse_file_put(ra->inode, ff, false, isdir); } static int fuse_open(struct inode *inode, struct file *file)