From 375792d34779efb631a1052751d96fb67c021db8 Mon Sep 17 00:00:00 2001 From: Tk-Glitch Date: Sun, 1 Nov 2020 20:03:52 +0100 Subject: [PATCH] Fix bcachefs patchset application on 5.8.18 and 5.9.3 --- PKGBUILD | 4 ++-- linux-tkg-patches/5.8/0008-5.8-bcachefs.patch | 8 ++++---- linux-tkg-patches/5.9/0008-5.9-bcachefs.patch | 18 +++++++++++++----- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 70d761f..fd6cfa3 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -220,7 +220,7 @@ case $_basever in '87bca363416655bc865fcb2cc0d1532cb010a61d9b9f625e3c15cd12eeee3a59' '19661ec0d39f9663452b34433214c755179894528bf73a42f6ba52ccf572832a' 'cd225e86d72eaf6c31ef3d7b20df397f4cc44ddd04389850691292cdf292b204' - '86414a20225deec084e0e48b35552b3a4eef67f76755b32a10febb7b6308dcb7' + 'e73c3a8a040a35eb48d1e0ce4f66dd6e6f69fd10ee5b1acf3a0334cbf7ffb0c4' '9fad4a40449e09522899955762c8928ae17f4cdaa16e01239fd12592e9d58177' '965a517a283f265a012545fbb5cc9e516efc9f6166d2aa1baf7293a32a1086b7' 'f5dbff4833a2e3ca94c202e5197894d5f1006c689ff149355353e77d2e17c943' @@ -278,7 +278,7 @@ case $_basever in 'fca63d15ca4502aebd73e76d7499b243d2c03db71ff5ab0bf5cf268b2e576320' '19661ec0d39f9663452b34433214c755179894528bf73a42f6ba52ccf572832a' 'b302ba6c5bbe8ed19b20207505d513208fae1e678cf4d8e7ac0b154e5fe3f456' - '78373044a416c512d74a1fb0227cbc2e4a47023791e21e2536626fce9401fbf7' + '7aba0a625404ed78e73c57860871af3b52610ae5196407286811322e3cd76aa3' '9fad4a40449e09522899955762c8928ae17f4cdaa16e01239fd12592e9d58177' 'a557b342111849a5f920bbe1c129f3ff1fc1eff62c6bd6685e0972fc88e39911' 'a5149d7220457d30e03e6999f35a050bce46acafc6230bfe6b4d4994c523516d' diff --git a/linux-tkg-patches/5.8/0008-5.8-bcachefs.patch b/linux-tkg-patches/5.8/0008-5.8-bcachefs.patch index 69cd9f9..304bab6 100644 --- a/linux-tkg-patches/5.8/0008-5.8-bcachefs.patch +++ b/linux-tkg-patches/5.8/0008-5.8-bcachefs.patch @@ -69686,10 +69686,10 @@ index 385759c4ce4b..5ca0ff7b9357 100644 } EXPORT_SYMBOL_GPL(replace_page_cache_page); --static int __add_to_page_cache_locked(struct page *page, -- struct address_space *mapping, -- pgoff_t offset, gfp_t gfp_mask, -- void **shadowp) +-noinline int __add_to_page_cache_locked(struct page *page, +- struct address_space *mapping, +- pgoff_t offset, gfp_t gfp_mask, +- void **shadowp) +static int add_to_page_cache_vec(struct page **pages, unsigned nr_pages, + struct address_space *mapping, + pgoff_t index, gfp_t gfp_mask, diff --git a/linux-tkg-patches/5.9/0008-5.9-bcachefs.patch b/linux-tkg-patches/5.9/0008-5.9-bcachefs.patch index daf1295..6c9d1fe 100644 --- a/linux-tkg-patches/5.9/0008-5.9-bcachefs.patch +++ b/linux-tkg-patches/5.9/0008-5.9-bcachefs.patch @@ -70091,10 +70091,10 @@ index 99c49eeae71b..5b724e5b4b89 100644 } EXPORT_SYMBOL_GPL(replace_page_cache_page); --static int __add_to_page_cache_locked(struct page *page, -- struct address_space *mapping, -- pgoff_t offset, gfp_t gfp_mask, -- void **shadowp) +-noinline int __add_to_page_cache_locked(struct page *page, +- struct address_space *mapping, +- pgoff_t offset, gfp_t gfp_mask, +- void **shadowp) +static int add_to_page_cache_vec(struct page **pages, unsigned nr_pages, + struct address_space *mapping, + pgoff_t index, gfp_t gfp_mask, @@ -70581,7 +70581,7 @@ index 99c49eeae71b..5b724e5b4b89 100644 /** * generic_file_buffered_read - generic file read routine * @iocb: the iocb to read -@@ -2158,276 +2509,116 @@ ssize_t generic_file_buffered_read(struct kiocb *iocb, +@@ -2158,284 +2509,116 @@ ssize_t generic_file_buffered_read(struct kiocb *iocb, struct iov_iter *iter, ssize_t written) { struct file *filp = iocb->ki_filp; @@ -70618,6 +70618,14 @@ index 99c49eeae71b..5b724e5b4b89 100644 + if (nr_pages > ARRAY_SIZE(pages_onstack)) + pages = kmalloc_array(nr_pages, sizeof(void *), GFP_KERNEL); +- /* +- * If we've already successfully copied some data, then we +- * can no longer safely return -EIOCBQUEUED. Hence mark +- * an async read NOWAIT at that point. +- */ +- if (written && (iocb->ki_flags & IOCB_WAITQ)) +- iocb->ki_flags |= IOCB_NOWAIT; +- - for (;;) { - struct page *page; - pgoff_t end_index;