From ba62ac4bdd826d59621009f3e6be9e7e33073c76 Mon Sep 17 00:00:00 2001 From: Peter Georg Date: Feb 21 2022 11:56:10 +0000 Subject: Add missing backport --- diff --git a/SOURCES/0107-iov_iter-Turn-iov_iter_fault_in_readable-into-fault_.patch b/SOURCES/0107-iov_iter-Turn-iov_iter_fault_in_readable-into-fault_.patch new file mode 100644 index 0000000..907b0f2 --- /dev/null +++ b/SOURCES/0107-iov_iter-Turn-iov_iter_fault_in_readable-into-fault_.patch @@ -0,0 +1,36 @@ +From a6294593e8a1290091d0b078d5d33da5e0cd3dfe Mon Sep 17 00:00:00 2001 +From: Andreas Gruenbacher +Date: Mon, 2 Aug 2021 14:54:16 +0200 +Subject: [Backport a6294593e8a1] iov_iter: Turn iov_iter_fault_in_readable + into fault_in_iov_iter_readable + +Turn iov_iter_fault_in_readable into a function that returns the number +of bytes not faulted in, similar to copy_to_user, instead of returning a +non-zero value when any of the requested pages couldn't be faulted in. +This supports the existing users that require all pages to be faulted in +as well as new users that are happy if any pages can be faulted in. + +Rename iov_iter_fault_in_readable to fault_in_iov_iter_readable to make +sure this change doesn't silently break things. + +Signed-off-by: Andreas Gruenbacher +--- + src/file.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/file.c b/src/file.c +index 424450e77ad52ae550e8de444dc393411d97cde6..a52388387175ac6ed8bfa31ee1af0c78455582be 100644 +--- a/src/file.c ++++ b/src/file.c +@@ -987,7 +987,7 @@ static ssize_t ntfs_compress_write(struct kiocb *iocb, struct iov_iter *from) + frame_vbo = pos & ~(frame_size - 1); + index = frame_vbo >> PAGE_SHIFT; + +- if (unlikely(iov_iter_fault_in_readable(from, bytes))) { ++ if (unlikely(fault_in_iov_iter_readable(from, bytes))) { + err = -EFAULT; + goto out; + } +-- +2.31.1 + diff --git a/SPECS/kmod-ntfs3.spec b/SPECS/kmod-ntfs3.spec index 8c04fa3..b08c809 100644 --- a/SPECS/kmod-ntfs3.spec +++ b/SPECS/kmod-ntfs3.spec @@ -130,6 +130,7 @@ Patch103: 0103-merge.patch Patch104: 0104-mm-don-t-include-linux-blkdev.h-in-linux-backing-dev.patch Patch105: 0105-ntfs3-use-bdev_nr_bytes-instead-of-open-coding-it.patch Patch106: 0106-ntfs3-use-sync_blockdev_nowait.patch +Patch107: 0107-iov_iter-Turn-iov_iter_fault_in_readable-into-fault_.patch Patch9999: 9999-enable-ntfs3.patch ExclusiveArch: x86_64 aarch64 ppc64le @@ -240,6 +241,7 @@ fi %changelog * Fri Feb 18 2022 Kmods SIG - 5.14.0.0-18 - Rebuild for 5.14.0-60.el9 +- Add missing backport * Tue Feb 15 2022 Kmods SIG - 5.14.0.0-17 - Rebuild for 5.14.0-58.el9