dax_io(): don't let non-error value escape via retval instead of EFAULT
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>
This commit is contained in:
Родитель
ccc2600b8a
Коммит
cadfbb6ec2
4
fs/dax.c
4
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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче