]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 12 Jun 2023 09:17:20 +0000 (11:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 12 Jun 2023 09:17:20 +0000 (11:17 +0200)
added patches:
cifs-get-rid-of-unused-parameter-in-reconn_setup_dfs_targets.patch
cifs-handle-empty-list-of-targets-in-cifs_reconnect.patch

queue-5.4/cifs-get-rid-of-unused-parameter-in-reconn_setup_dfs_targets.patch [new file with mode: 0644]
queue-5.4/cifs-handle-empty-list-of-targets-in-cifs_reconnect.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/cifs-get-rid-of-unused-parameter-in-reconn_setup_dfs_targets.patch b/queue-5.4/cifs-get-rid-of-unused-parameter-in-reconn_setup_dfs_targets.patch
new file mode 100644 (file)
index 0000000..508829f
--- /dev/null
@@ -0,0 +1,42 @@
+From baf3f08ef4083b76ca67b143e135213a7f941879 Mon Sep 17 00:00:00 2001
+From: Paulo Alcantara <pc@cjr.nz>
+Date: Tue, 19 May 2020 15:38:29 -0300
+Subject: cifs: get rid of unused parameter in reconn_setup_dfs_targets()
+
+From: Paulo Alcantara <pc@cjr.nz>
+
+commit baf3f08ef4083b76ca67b143e135213a7f941879 upstream.
+
+The target iterator parameter "it" is not used in
+reconn_setup_dfs_targets(), so just remove it.
+
+Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
+Reviewed-by: Aurelien Aptel <aaptel@suse.com>
+Signed-off-by: Steve French <stfrench@microsoft.com>
+Signed-off-by: Rishabh Bhatnagar <risbhat@amazon.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/cifs/connect.c |    5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+--- a/fs/cifs/connect.c
++++ b/fs/cifs/connect.c
+@@ -469,8 +469,7 @@ static void reconn_inval_dfs_target(stru
+ }
+ static inline int reconn_setup_dfs_targets(struct cifs_sb_info *cifs_sb,
+-                                         struct dfs_cache_tgt_list *tl,
+-                                         struct dfs_cache_tgt_iterator **it)
++                                         struct dfs_cache_tgt_list *tl)
+ {
+       if (!cifs_sb->origin_fullpath)
+               return -EOPNOTSUPP;
+@@ -515,7 +514,7 @@ cifs_reconnect(struct TCP_Server_Info *s
+       } else {
+               cifs_sb = CIFS_SB(sb);
+-              rc = reconn_setup_dfs_targets(cifs_sb, &tgt_list, &tgt_it);
++              rc = reconn_setup_dfs_targets(cifs_sb, &tgt_list);
+               if (rc && (rc != -EOPNOTSUPP)) {
+                       cifs_server_dbg(VFS, "%s: no target servers for DFS failover\n",
+                                __func__);
diff --git a/queue-5.4/cifs-handle-empty-list-of-targets-in-cifs_reconnect.patch b/queue-5.4/cifs-handle-empty-list-of-targets-in-cifs_reconnect.patch
new file mode 100644 (file)
index 0000000..13344d6
--- /dev/null
@@ -0,0 +1,43 @@
+From a52930353eaf443489a350a135c5525a4acbbf56 Mon Sep 17 00:00:00 2001
+From: Paulo Alcantara <pc@cjr.nz>
+Date: Tue, 21 Jul 2020 09:36:41 -0300
+Subject: cifs: handle empty list of targets in cifs_reconnect()
+
+From: Paulo Alcantara <pc@cjr.nz>
+
+commit a52930353eaf443489a350a135c5525a4acbbf56 upstream.
+
+In case there were no cached DFS referrals in
+reconn_setup_dfs_targets(), set cifs_sb to NULL prior to calling
+reconn_set_next_dfs_target() so it would not try to access an empty
+tgt_list.
+
+Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
+Reviewed-by: Aurelien Aptel <aaptel@suse.com>
+Signed-off-by: Steve French <stfrench@microsoft.com>
+Signed-off-by: Rishabh Bhatnagar <risbhat@amazon.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/cifs/connect.c |   10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+--- a/fs/cifs/connect.c
++++ b/fs/cifs/connect.c
+@@ -513,11 +513,13 @@ cifs_reconnect(struct TCP_Server_Info *s
+               sb = NULL;
+       } else {
+               cifs_sb = CIFS_SB(sb);
+-
+               rc = reconn_setup_dfs_targets(cifs_sb, &tgt_list);
+-              if (rc && (rc != -EOPNOTSUPP)) {
+-                      cifs_server_dbg(VFS, "%s: no target servers for DFS failover\n",
+-                               __func__);
++              if (rc) {
++                      cifs_sb = NULL;
++                      if (rc != -EOPNOTSUPP) {
++                              cifs_server_dbg(VFS, "%s: no target servers for DFS failover\n",
++                                              __func__);
++                      }
+               } else {
+                       server->nr_targets = dfs_cache_get_nr_tgts(&tgt_list);
+               }
index fc6e893b24c7f8ad6693672128ca978e3f56649a..2e2f575e32aa139fd2d8aa122484d015dab65c14 100644 (file)
@@ -35,3 +35,5 @@ bonding-gcc13-synchronize-bond_-a-t-lb_xmit-types.patch
 i2c-sprd-delete-i2c-adapter-in-.remove-s-error-path.patch
 eeprom-at24-also-select-regmap.patch
 ext4-only-check-dquot_initialize_needed-when-debugging.patch
+cifs-get-rid-of-unused-parameter-in-reconn_setup_dfs_targets.patch
+cifs-handle-empty-list-of-targets-in-cifs_reconnect.patch