]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 Feb 2020 17:21:12 +0000 (18:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 Feb 2020 17:21:12 +0000 (18:21 +0100)
added patches:
ib-mlx5-fix-outstanding_pi-index-for-gsi-qps.patch
nfsd-fix-delay-timer-on-32-bit-architectures.patch
nfsd-fix-jiffies-time_t-mixup-in-lru-list.patch

queue-4.9/ib-mlx5-fix-outstanding_pi-index-for-gsi-qps.patch [new file with mode: 0644]
queue-4.9/nfsd-fix-delay-timer-on-32-bit-architectures.patch [new file with mode: 0644]
queue-4.9/nfsd-fix-jiffies-time_t-mixup-in-lru-list.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/ib-mlx5-fix-outstanding_pi-index-for-gsi-qps.patch b/queue-4.9/ib-mlx5-fix-outstanding_pi-index-for-gsi-qps.patch
new file mode 100644 (file)
index 0000000..f4ef1bd
--- /dev/null
@@ -0,0 +1,40 @@
+From b5671afe5e39ed71e94eae788bacdcceec69db09 Mon Sep 17 00:00:00 2001
+From: Prabhath Sajeepa <psajeepa@purestorage.com>
+Date: Thu, 12 Dec 2019 17:11:29 -0700
+Subject: IB/mlx5: Fix outstanding_pi index for GSI qps
+
+From: Prabhath Sajeepa <psajeepa@purestorage.com>
+
+commit b5671afe5e39ed71e94eae788bacdcceec69db09 upstream.
+
+Commit b0ffeb537f3a ("IB/mlx5: Fix iteration overrun in GSI qps") changed
+the way outstanding WRs are tracked for the GSI QP. But the fix did not
+cover the case when a call to ib_post_send() fails and updates index to
+track outstanding.
+
+Since the prior commmit outstanding_pi should not be bounded otherwise the
+loop generate_completions() will fail.
+
+Fixes: b0ffeb537f3a ("IB/mlx5: Fix iteration overrun in GSI qps")
+Link: https://lore.kernel.org/r/1576195889-23527-1-git-send-email-psajeepa@purestorage.com
+Signed-off-by: Prabhath Sajeepa <psajeepa@purestorage.com>
+Acked-by: Leon Romanovsky <leonro@mellanox.com>
+Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/infiniband/hw/mlx5/gsi.c |    3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/infiniband/hw/mlx5/gsi.c
++++ b/drivers/infiniband/hw/mlx5/gsi.c
+@@ -507,8 +507,7 @@ int mlx5_ib_gsi_post_send(struct ib_qp *
+               ret = ib_post_send(tx_qp, &cur_wr.wr, bad_wr);
+               if (ret) {
+                       /* Undo the effect of adding the outstanding wr */
+-                      gsi->outstanding_pi = (gsi->outstanding_pi - 1) %
+-                                            gsi->cap.max_send_wr;
++                      gsi->outstanding_pi--;
+                       goto err;
+               }
+               spin_unlock_irqrestore(&gsi->lock, flags);
diff --git a/queue-4.9/nfsd-fix-delay-timer-on-32-bit-architectures.patch b/queue-4.9/nfsd-fix-delay-timer-on-32-bit-architectures.patch
new file mode 100644 (file)
index 0000000..aeb30ac
--- /dev/null
@@ -0,0 +1,40 @@
+From 2561c92b12f4f4e386d453556685f75775c0938b Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Sun, 3 Nov 2019 22:32:20 +0100
+Subject: nfsd: fix delay timer on 32-bit architectures
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit 2561c92b12f4f4e386d453556685f75775c0938b upstream.
+
+The nfsd4_cb_layout_done() function takes a 'time_t' value,
+multiplied by NSEC_PER_SEC*2 to get a nanosecond value.
+
+This works fine on 64-bit architectures, but on 32-bit, any
+value over 1 second results in a signed integer overflow
+with unexpected results.
+
+Cast one input to a 64-bit type in order to produce the
+same result that we have on 64-bit architectures, regarless
+of the type of nfsd4_lease.
+
+Fixes: 6b9b21073d3b ("nfsd: give up on CB_LAYOUTRECALLs after two lease periods")
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: J. Bruce Fields <bfields@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/nfsd/nfs4layouts.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/nfsd/nfs4layouts.c
++++ b/fs/nfsd/nfs4layouts.c
+@@ -680,7 +680,7 @@ nfsd4_cb_layout_done(struct nfsd4_callba
+               /* Client gets 2 lease periods to return it */
+               cutoff = ktime_add_ns(task->tk_start,
+-                                       nn->nfsd4_lease * NSEC_PER_SEC * 2);
++                                       (u64)nn->nfsd4_lease * NSEC_PER_SEC * 2);
+               if (ktime_before(now, cutoff)) {
+                       rpc_delay(task, HZ/100); /* 10 mili-seconds */
diff --git a/queue-4.9/nfsd-fix-jiffies-time_t-mixup-in-lru-list.patch b/queue-4.9/nfsd-fix-jiffies-time_t-mixup-in-lru-list.patch
new file mode 100644 (file)
index 0000000..0405e9e
--- /dev/null
@@ -0,0 +1,53 @@
+From 9594497f2c78993cb66b696122f7c65528ace985 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Mon, 4 Nov 2019 14:43:17 +0100
+Subject: nfsd: fix jiffies/time_t mixup in LRU list
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit 9594497f2c78993cb66b696122f7c65528ace985 upstream.
+
+The nfsd4_blocked_lock->nbl_time timestamp is recorded in jiffies,
+but then compared to a CLOCK_REALTIME timestamp later on, which makes
+no sense.
+
+For consistency with the other timestamps, change this to use a time_t.
+
+This is a change in behavior, which may cause regressions, but the
+current code is not sensible. On a system with CONFIG_HZ=1000,
+the 'time_after((unsigned long)nbl->nbl_time, (unsigned long)cutoff))'
+check is false for roughly the first 18 days of uptime and then true
+for the next 49 days.
+
+Fixes: 7919d0a27f1e ("nfsd: add a LRU list for blocked locks")
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: J. Bruce Fields <bfields@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/nfsd/nfs4state.c |    2 +-
+ fs/nfsd/state.h     |    2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+--- a/fs/nfsd/nfs4state.c
++++ b/fs/nfsd/nfs4state.c
+@@ -6034,7 +6034,7 @@ nfsd4_lock(struct svc_rqst *rqstp, struc
+       }
+       if (fl_flags & FL_SLEEP) {
+-              nbl->nbl_time = jiffies;
++              nbl->nbl_time = get_seconds();
+               spin_lock(&nn->blocked_locks_lock);
+               list_add_tail(&nbl->nbl_list, &lock_sop->lo_blocked);
+               list_add_tail(&nbl->nbl_lru, &nn->blocked_locks_lru);
+--- a/fs/nfsd/state.h
++++ b/fs/nfsd/state.h
+@@ -591,7 +591,7 @@ static inline bool nfsd4_stateid_generat
+ struct nfsd4_blocked_lock {
+       struct list_head        nbl_list;
+       struct list_head        nbl_lru;
+-      unsigned long           nbl_time;
++      time_t                  nbl_time;
+       struct file_lock        nbl_lock;
+       struct knfsd_fh         nbl_fh;
+       struct nfsd4_callback   nbl_cb;
index dd2e8bb194cd6c84da9450bb318a3e341ab8b97c..f73ab7d2a5a49e10d8cf9b36d4bb7f6a37c7e1b8 100644 (file)
@@ -64,3 +64,6 @@ nfc-pn544-adjust-indentation-in-pn544_hci_check_presence.patch
 ppp-adjust-indentation-into-ppp_async_input.patch
 net-smc911x-adjust-indentation-in-smc911x_phy_configure.patch
 net-tulip-adjust-indentation-in-dmfe-uli526x-_init_module.patch
+ib-mlx5-fix-outstanding_pi-index-for-gsi-qps.patch
+nfsd-fix-delay-timer-on-32-bit-architectures.patch
+nfsd-fix-jiffies-time_t-mixup-in-lru-list.patch