fuse: no ENOENT from fuse device read
authorMiklos Szeredi <mszeredi@suse.cz>
Wed, 17 Oct 2007 06:31:05 +0000 (23:31 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 17 Oct 2007 15:43:04 +0000 (08:43 -0700)
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 <mszeredi@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/fuse/dev.c

index cc6c2908fb1221395d145af9fc596d2036c32146..db534bcde45f6ff52a7cbfb44fcb8b49ea9bbb9d 100644 (file)
@@ -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;
        }