]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
dax_io(): don't let non-error value escape via retval instead of EFAULT
authorAl Viro <viro@ZenIV.linux.org.uk>
Wed, 11 Nov 2015 02:42:49 +0000 (19:42 -0700)
committerDan Duval <dan.duval@oracle.com>
Wed, 7 Dec 2016 17:25:12 +0000 (12:25 -0500)
Orabug: 22913653

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Cc: stable@vger.kernel.org # 4.0+
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit cadfbb6ec2e55171479191046142c927a8b12d87)
Signed-off-by: Dan Duval <dan.duval@oracle.com>
fs/dax.c

index 131fd35ae39d53f8a9ef7bdd1aaa61677beda5f0..8e17b371aeb894620ac2cc5d7a7e2aaee7095310 100644 (file)
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -174,8 +174,10 @@ static ssize_t dax_io(struct inode *inode, struct iov_iter *iter,
                else
                        len = iov_iter_zero(max - pos, iter);
 
-               if (!len)
+               if (!len) {
+                       retval = -EFAULT;
                        break;
+               }
 
                pos += len;
                addr += len;