]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fix the regression from "direct-io: Fix negative return from dio read beyond eof"
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 8 Dec 2015 17:22:47 +0000 (12:22 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 31 Jan 2016 19:25:55 +0000 (11:25 -0800)
commit 2d4594acbf6d8f75a27f3578476b6a27d8b13ebb upstream.

Sure, it's better to bail out of past-the-eof read and return 0 than return
a bogus negative value on such.  Only we'd better make sure we are bailing out
with 0 and not -ENOMEM...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/direct-io.c

index 8897af41ae900db16906a5e99a544fd1a0ae3606..3e116320f01bc505a59a881652073c445ed79139 100644 (file)
@@ -1167,6 +1167,7 @@ do_blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
                if (dio->flags & DIO_LOCKING)
                        mutex_unlock(&inode->i_mutex);
                kmem_cache_free(dio_cache, dio);
+               retval = 0;
                goto out;
        }