|
|
ba62ac |
From a6294593e8a1290091d0b078d5d33da5e0cd3dfe Mon Sep 17 00:00:00 2001
|
|
|
ba62ac |
From: Andreas Gruenbacher <agruenba@redhat.com>
|
|
|
ba62ac |
Date: Mon, 2 Aug 2021 14:54:16 +0200
|
|
|
ba62ac |
Subject: [Backport a6294593e8a1] iov_iter: Turn iov_iter_fault_in_readable
|
|
|
ba62ac |
into fault_in_iov_iter_readable
|
|
|
ba62ac |
|
|
|
ba62ac |
Turn iov_iter_fault_in_readable into a function that returns the number
|
|
|
ba62ac |
of bytes not faulted in, similar to copy_to_user, instead of returning a
|
|
|
ba62ac |
non-zero value when any of the requested pages couldn't be faulted in.
|
|
|
ba62ac |
This supports the existing users that require all pages to be faulted in
|
|
|
ba62ac |
as well as new users that are happy if any pages can be faulted in.
|
|
|
ba62ac |
|
|
|
ba62ac |
Rename iov_iter_fault_in_readable to fault_in_iov_iter_readable to make
|
|
|
ba62ac |
sure this change doesn't silently break things.
|
|
|
ba62ac |
|
|
|
ba62ac |
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
|
|
|
ba62ac |
---
|
|
|
ba62ac |
src/file.c | 2 +-
|
|
|
ba62ac |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
ba62ac |
|
|
|
ba62ac |
diff --git a/src/file.c b/src/file.c
|
|
|
ba62ac |
index 424450e77ad52ae550e8de444dc393411d97cde6..a52388387175ac6ed8bfa31ee1af0c78455582be 100644
|
|
|
ba62ac |
--- a/src/file.c
|
|
|
ba62ac |
+++ b/src/file.c
|
|
|
ba62ac |
@@ -987,7 +987,7 @@ static ssize_t ntfs_compress_write(struct kiocb *iocb, struct iov_iter *from)
|
|
|
ba62ac |
frame_vbo = pos & ~(frame_size - 1);
|
|
|
ba62ac |
index = frame_vbo >> PAGE_SHIFT;
|
|
|
ba62ac |
|
|
|
ba62ac |
- if (unlikely(iov_iter_fault_in_readable(from, bytes))) {
|
|
|
ba62ac |
+ if (unlikely(fault_in_iov_iter_readable(from, bytes))) {
|
|
|
ba62ac |
err = -EFAULT;
|
|
|
ba62ac |
goto out;
|
|
|
ba62ac |
}
|
|
|
ba62ac |
--
|
|
|
ba62ac |
2.31.1
|
|
|
ba62ac |
|