From: Sasha Levin Date: Wed, 18 Jan 2023 20:22:25 +0000 (-0500) Subject: Fixes for 4.19 X-Git-Tag: v4.14.304~58 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7cc0151a04f1e6b9ddb5ff92bf5da4d7a31d0e2d;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.19 Signed-off-by: Sasha Levin --- diff --git a/queue-4.19/f2fs-let-s-avoid-panic-if-extent_tree-is-not-created.patch b/queue-4.19/f2fs-let-s-avoid-panic-if-extent_tree-is-not-created.patch new file mode 100644 index 00000000000..31d98935a6c --- /dev/null +++ b/queue-4.19/f2fs-let-s-avoid-panic-if-extent_tree-is-not-created.patch @@ -0,0 +1,70 @@ +From 8672194f0fb04777610707a55668c94605bcc479 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 21 Dec 2022 16:14:10 -0800 +Subject: f2fs: let's avoid panic if extent_tree is not created + +From: Jaegeuk Kim + +[ Upstream commit df9d44b645b83fffccfb4e28c1f93376585fdec8 ] + +This patch avoids the below panic. + +pc : __lookup_extent_tree+0xd8/0x760 +lr : f2fs_do_write_data_page+0x104/0x87c +sp : ffffffc010cbb3c0 +x29: ffffffc010cbb3e0 x28: 0000000000000000 +x27: ffffff8803e7f020 x26: ffffff8803e7ed40 +x25: ffffff8803e7f020 x24: ffffffc010cbb460 +x23: ffffffc010cbb480 x22: 0000000000000000 +x21: 0000000000000000 x20: ffffffff22e90900 +x19: 0000000000000000 x18: ffffffc010c5d080 +x17: 0000000000000000 x16: 0000000000000020 +x15: ffffffdb1acdbb88 x14: ffffff888759e2b0 +x13: 0000000000000000 x12: ffffff802da49000 +x11: 000000000a001200 x10: ffffff8803e7ed40 +x9 : ffffff8023195800 x8 : ffffff802da49078 +x7 : 0000000000000001 x6 : 0000000000000000 +x5 : 0000000000000006 x4 : ffffffc010cbba28 +x3 : 0000000000000000 x2 : ffffffc010cbb480 +x1 : 0000000000000000 x0 : ffffff8803e7ed40 +Call trace: + __lookup_extent_tree+0xd8/0x760 + f2fs_do_write_data_page+0x104/0x87c + f2fs_write_single_data_page+0x420/0xb60 + f2fs_write_cache_pages+0x418/0xb1c + __f2fs_write_data_pages+0x428/0x58c + f2fs_write_data_pages+0x30/0x40 + do_writepages+0x88/0x190 + __writeback_single_inode+0x48/0x448 + writeback_sb_inodes+0x468/0x9e8 + __writeback_inodes_wb+0xb8/0x2a4 + wb_writeback+0x33c/0x740 + wb_do_writeback+0x2b4/0x400 + wb_workfn+0xe4/0x34c + process_one_work+0x24c/0x5bc + worker_thread+0x3e8/0xa50 + kthread+0x150/0x1b4 + +Signed-off-by: Jaegeuk Kim +Signed-off-by: Sasha Levin +--- + fs/f2fs/extent_cache.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c +index 36d6b561b524..e85ed4aa9d46 100644 +--- a/fs/f2fs/extent_cache.c ++++ b/fs/f2fs/extent_cache.c +@@ -375,7 +375,8 @@ static bool f2fs_lookup_extent_tree(struct inode *inode, pgoff_t pgofs, + struct extent_node *en; + bool ret = false; + +- f2fs_bug_on(sbi, !et); ++ if (!et) ++ return false; + + trace_f2fs_lookup_extent_tree_start(inode, pgofs); + +-- +2.35.1 + diff --git a/queue-4.19/net-ethtool-ioctl-return-eopnotsupp-if-we-have-no-ph.patch b/queue-4.19/net-ethtool-ioctl-return-eopnotsupp-if-we-have-no-ph.patch new file mode 100644 index 00000000000..52e489a1fc4 --- /dev/null +++ b/queue-4.19/net-ethtool-ioctl-return-eopnotsupp-if-we-have-no-ph.patch @@ -0,0 +1,38 @@ +From e63f73a3ef4d5225e8e9016b254b862fcc6adc0e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 26 Dec 2022 14:48:23 +0300 +Subject: net/ethtool/ioctl: return -EOPNOTSUPP if we have no phy stats + +From: Daniil Tatianin + +[ Upstream commit 9deb1e9fb88b1120a908676fa33bdf9e2eeaefce ] + +It's not very useful to copy back an empty ethtool_stats struct and +return 0 if we didn't actually have any stats. This also allows for +further simplification of this function in the future commits. + +Signed-off-by: Daniil Tatianin +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + net/core/ethtool.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/net/core/ethtool.c b/net/core/ethtool.c +index 4db9512feba8..d007f1cca64c 100644 +--- a/net/core/ethtool.c ++++ b/net/core/ethtool.c +@@ -2023,7 +2023,8 @@ static int ethtool_get_phy_stats(struct net_device *dev, void __user *useraddr) + return n_stats; + if (n_stats > S32_MAX / sizeof(u64)) + return -ENOMEM; +- WARN_ON_ONCE(!n_stats); ++ if (WARN_ON_ONCE(!n_stats)) ++ return -EOPNOTSUPP; + + if (copy_from_user(&stats, useraddr, sizeof(stats))) + return -EFAULT; +-- +2.35.1 + diff --git a/queue-4.19/pnfs-filelayout-fix-coalescing-test-for-single-ds.patch b/queue-4.19/pnfs-filelayout-fix-coalescing-test-for-single-ds.patch new file mode 100644 index 00000000000..f2e6a546be1 --- /dev/null +++ b/queue-4.19/pnfs-filelayout-fix-coalescing-test-for-single-ds.patch @@ -0,0 +1,49 @@ +From ef7213b7afbb7a186d06ef515baf52a6540a5332 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 20 Dec 2022 12:31:29 -0500 +Subject: pNFS/filelayout: Fix coalescing test for single DS + +From: Olga Kornievskaia + +[ Upstream commit a6b9d2fa0024e7e399c26facd0fb466b7396e2b9 ] + +When there is a single DS no striping constraints need to be placed on +the IO. When such constraint is applied then buffered reads don't +coalesce to the DS's rsize. + +Signed-off-by: Olga Kornievskaia +Signed-off-by: Trond Myklebust +Signed-off-by: Sasha Levin +--- + fs/nfs/filelayout/filelayout.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c +index e8e825497cbd..015d39ac2c8f 100644 +--- a/fs/nfs/filelayout/filelayout.c ++++ b/fs/nfs/filelayout/filelayout.c +@@ -837,6 +837,12 @@ filelayout_alloc_lseg(struct pnfs_layout_hdr *layoutid, + return &fl->generic_hdr; + } + ++static bool ++filelayout_lseg_is_striped(const struct nfs4_filelayout_segment *flseg) ++{ ++ return flseg->num_fh > 1; ++} ++ + /* + * filelayout_pg_test(). Called by nfs_can_coalesce_requests() + * +@@ -857,6 +863,8 @@ filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, + size = pnfs_generic_pg_test(pgio, prev, req); + if (!size) + return 0; ++ else if (!filelayout_lseg_is_striped(FILELAYOUT_LSEG(pgio->pg_lseg))) ++ return size; + + /* see if req and prev are in the same stripe */ + if (prev) { +-- +2.35.1 + diff --git a/queue-4.19/rdma-srp-move-large-values-to-a-new-enum-for-gcc13.patch b/queue-4.19/rdma-srp-move-large-values-to-a-new-enum-for-gcc13.patch new file mode 100644 index 00000000000..ec7376d2954 --- /dev/null +++ b/queue-4.19/rdma-srp-move-large-values-to-a-new-enum-for-gcc13.patch @@ -0,0 +1,62 @@ +From feec2db2813d926de247162b9addaff41d617a89 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 12 Dec 2022 13:04:11 +0100 +Subject: RDMA/srp: Move large values to a new enum for gcc13 + +From: Jiri Slaby (SUSE) + +[ Upstream commit 56c5dab20a6391604df9521f812c01d1e3fe1bd0 ] + +Since gcc13, each member of an enum has the same type as the enum [1]. And +that is inherited from its members. Provided these two: + SRP_TAG_NO_REQ = ~0U, + SRP_TAG_TSK_MGMT = 1U << 31 +all other members are unsigned ints. + +Esp. with SRP_MAX_SGE and SRP_TSK_MGMT_SQ_SIZE and their use in min(), +this results in the following warnings: + include/linux/minmax.h:20:35: error: comparison of distinct pointer types lacks a cast + drivers/infiniband/ulp/srp/ib_srp.c:563:42: note: in expansion of macro 'min' + + include/linux/minmax.h:20:35: error: comparison of distinct pointer types lacks a cast + drivers/infiniband/ulp/srp/ib_srp.c:2369:27: note: in expansion of macro 'min' + +So move the large values away to a separate enum, so that they don't +affect other members. + +[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36113 + +Link: https://lore.kernel.org/r/20221212120411.13750-1-jirislaby@kernel.org +Signed-off-by: Jiri Slaby (SUSE) +Reviewed-by: Bart Van Assche +Signed-off-by: Leon Romanovsky +Signed-off-by: Sasha Levin +--- + drivers/infiniband/ulp/srp/ib_srp.h | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/drivers/infiniband/ulp/srp/ib_srp.h b/drivers/infiniband/ulp/srp/ib_srp.h +index a2706086b9c7..10cb50b90d7f 100644 +--- a/drivers/infiniband/ulp/srp/ib_srp.h ++++ b/drivers/infiniband/ulp/srp/ib_srp.h +@@ -63,12 +63,14 @@ enum { + SRP_DEFAULT_CMD_SQ_SIZE = SRP_DEFAULT_QUEUE_SIZE - SRP_RSP_SQ_SIZE - + SRP_TSK_MGMT_SQ_SIZE, + +- SRP_TAG_NO_REQ = ~0U, +- SRP_TAG_TSK_MGMT = 1U << 31, +- + SRP_MAX_PAGES_PER_MR = 512, + }; + ++enum { ++ SRP_TAG_NO_REQ = ~0U, ++ SRP_TAG_TSK_MGMT = BIT(31), ++}; ++ + enum srp_target_state { + SRP_TARGET_SCANNING, + SRP_TARGET_LIVE, +-- +2.35.1 + diff --git a/queue-4.19/series b/queue-4.19/series new file mode 100644 index 00000000000..ef85acc01e3 --- /dev/null +++ b/queue-4.19/series @@ -0,0 +1,4 @@ +pnfs-filelayout-fix-coalescing-test-for-single-ds.patch +net-ethtool-ioctl-return-eopnotsupp-if-we-have-no-ph.patch +rdma-srp-move-large-values-to-a-new-enum-for-gcc13.patch +f2fs-let-s-avoid-panic-if-extent_tree-is-not-created.patch