提交 890559e3 编写于 作者: A Al Viro

orangefs_bufmap_copy_from_iovec(): fix EFAULT handling

short copy here should mean instant EFAULT, not "move to the
next page and hope it fails there, this time with nothing
copied"
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 4f7d029b
...@@ -521,13 +521,11 @@ int orangefs_bufmap_copy_from_iovec(struct iov_iter *iter, ...@@ -521,13 +521,11 @@ int orangefs_bufmap_copy_from_iovec(struct iov_iter *iter,
size_t n = size; size_t n = size;
if (n > PAGE_SIZE) if (n > PAGE_SIZE)
n = PAGE_SIZE; n = PAGE_SIZE;
n = copy_page_from_iter(page, 0, n, iter); if (copy_page_from_iter(page, 0, n, iter) != n)
if (!n)
return -EFAULT; return -EFAULT;
size -= n; size -= n;
} }
return 0; return 0;
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册