From: Miklos Szeredi Date: Wed, 17 Oct 2007 06:31:05 +0000 (-0700) Subject: fuse: no ENOENT from fuse device read X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c9c9d7df5f8aed8b738f1ace45700e2001c1faeb;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git fuse: no ENOENT from fuse device read Don't return -ENOENT for a read() on the fuse device when the request was aborted. Instead return -ENODEV, meaning the filesystem has been force-umounted or aborted. Previously ENOENT meant that the request was interrupted, but now the 'aborted' flag is not set in case of interrupts. Signed-off-by: Miklos Szeredi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index cc6c2908fb12..db534bcde45f 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -747,11 +747,12 @@ static ssize_t fuse_dev_read(struct kiocb *iocb, const struct iovec *iov, fuse_copy_finish(&cs); spin_lock(&fc->lock); req->locked = 0; - if (!err && req->aborted) - err = -ENOENT; + if (req->aborted) { + request_end(fc, req); + return -ENODEV; + } if (err) { - if (!req->aborted) - req->out.h.error = -EIO; + req->out.h.error = -EIO; request_end(fc, req); return err; }