aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Viro <[email protected]>2015-11-10 19:42:49 -0700
committerJens Axboe <[email protected]>2015-11-11 09:36:57 -0700
commitcadfbb6ec2e55171479191046142c927a8b12d87 (patch)
tree3e1c3b1b4419eef0805da29da93d7448db404d94
parentccc2600b8a28f3eb0c126cd00312baba1c22cccb (diff)
dax_io(): don't let non-error value escape via retval instead of EFAULT
Signed-off-by: Al Viro <[email protected]> Reported-by: Sasha Levin <[email protected]> Cc: [email protected] # 4.0+ Signed-off-by: Jens Axboe <[email protected]>
-rw-r--r--fs/dax.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/dax.c b/fs/dax.c
index a86d3cc2b389..7b653e9aa8d1 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -169,8 +169,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;