]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.14
authorSasha Levin <sashal@kernel.org>
Wed, 18 Jan 2023 20:22:26 +0000 (15:22 -0500)
committerSasha Levin <sashal@kernel.org>
Wed, 18 Jan 2023 20:22:26 +0000 (15:22 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.14/f2fs-let-s-avoid-panic-if-extent_tree-is-not-created.patch [new file with mode: 0644]
queue-4.14/net-ethtool-ioctl-return-eopnotsupp-if-we-have-no-ph.patch [new file with mode: 0644]
queue-4.14/pnfs-filelayout-fix-coalescing-test-for-single-ds.patch [new file with mode: 0644]
queue-4.14/rdma-srp-move-large-values-to-a-new-enum-for-gcc13.patch [new file with mode: 0644]
queue-4.14/series [new file with mode: 0644]

diff --git a/queue-4.14/f2fs-let-s-avoid-panic-if-extent_tree-is-not-created.patch b/queue-4.14/f2fs-let-s-avoid-panic-if-extent_tree-is-not-created.patch
new file mode 100644 (file)
index 0000000..ddd5f9e
--- /dev/null
@@ -0,0 +1,70 @@
+From 77b5045f767c9ffd6b56aaf4c9d02524a774bdab Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 21 Dec 2022 16:14:10 -0800
+Subject: f2fs: let's avoid panic if extent_tree is not created
+
+From: Jaegeuk Kim <jaegeuk@kernel.org>
+
+[ 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 <jaegeuk@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 042c9d4f73cf..785c32f3b161 100644
+--- a/fs/f2fs/extent_cache.c
++++ b/fs/f2fs/extent_cache.c
+@@ -376,7 +376,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.14/net-ethtool-ioctl-return-eopnotsupp-if-we-have-no-ph.patch b/queue-4.14/net-ethtool-ioctl-return-eopnotsupp-if-we-have-no-ph.patch
new file mode 100644 (file)
index 0000000..6315519
--- /dev/null
@@ -0,0 +1,38 @@
+From a72bd6f5db91289711a8cca9363e3bb2258be8fb Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 26 Dec 2022 14:48:23 +0300
+Subject: net/ethtool/ioctl: return -EOPNOTSUPP if we have no phy stats
+
+From: Daniil Tatianin <d-tatianin@yandex-team.ru>
+
+[ 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 <d-tatianin@yandex-team.ru>
+Reviewed-by: Andrew Lunn <andrew@lunn.ch>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 749d48393d06..fe2217e339dc 100644
+--- a/net/core/ethtool.c
++++ b/net/core/ethtool.c
+@@ -1969,7 +1969,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.14/pnfs-filelayout-fix-coalescing-test-for-single-ds.patch b/queue-4.14/pnfs-filelayout-fix-coalescing-test-for-single-ds.patch
new file mode 100644 (file)
index 0000000..9f4649b
--- /dev/null
@@ -0,0 +1,49 @@
+From 490605abc06770d39dcfc4bc3e05d3c4dee87a61 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 20 Dec 2022 12:31:29 -0500
+Subject: pNFS/filelayout: Fix coalescing test for single DS
+
+From: Olga Kornievskaia <olga.kornievskaia@gmail.com>
+
+[ 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 <kolga@netapp.com>
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 38179e5a6a00..9b24d0bc9b39 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.14/rdma-srp-move-large-values-to-a-new-enum-for-gcc13.patch b/queue-4.14/rdma-srp-move-large-values-to-a-new-enum-for-gcc13.patch
new file mode 100644 (file)
index 0000000..461a503
--- /dev/null
@@ -0,0 +1,62 @@
+From 40c6e176e1dee51e3ac84c7aefd2fa807bbd2a55 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+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) <jirislaby@kernel.org>
+
+[ 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) <jirislaby@kernel.org>
+Reviewed-by: Bart Van Assche <bvanassche@acm.org>
+Signed-off-by: Leon Romanovsky <leon@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ 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 ab9077b81d5a..89b5133ceaa6 100644
+--- a/drivers/infiniband/ulp/srp/ib_srp.h
++++ b/drivers/infiniband/ulp/srp/ib_srp.h
+@@ -62,12 +62,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.14/series b/queue-4.14/series
new file mode 100644 (file)
index 0000000..ef85acc
--- /dev/null
@@ -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