]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 Feb 2020 17:21:15 +0000 (18:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 Feb 2020 17:21:15 +0000 (18:21 +0100)
added patches:
ib-core-fix-odp-get-user-pages-flow.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
nfsd-return-the-correct-number-of-bytes-written-to-the-file.patch

queue-4.19/ib-core-fix-odp-get-user-pages-flow.patch [new file with mode: 0644]
queue-4.19/ib-mlx5-fix-outstanding_pi-index-for-gsi-qps.patch [new file with mode: 0644]
queue-4.19/nfsd-fix-delay-timer-on-32-bit-architectures.patch [new file with mode: 0644]
queue-4.19/nfsd-fix-jiffies-time_t-mixup-in-lru-list.patch [new file with mode: 0644]
queue-4.19/nfsd-return-the-correct-number-of-bytes-written-to-the-file.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/ib-core-fix-odp-get-user-pages-flow.patch b/queue-4.19/ib-core-fix-odp-get-user-pages-flow.patch
new file mode 100644 (file)
index 0000000..26efdb0
--- /dev/null
@@ -0,0 +1,37 @@
+From d07de8bd1709a80a282963ad7b2535148678a9e4 Mon Sep 17 00:00:00 2001
+From: Yishai Hadas <yishaih@mellanox.com>
+Date: Sun, 22 Dec 2019 14:46:48 +0200
+Subject: IB/core: Fix ODP get user pages flow
+
+From: Yishai Hadas <yishaih@mellanox.com>
+
+commit d07de8bd1709a80a282963ad7b2535148678a9e4 upstream.
+
+The nr_pages argument of get_user_pages_remote() should always be in terms
+of the system page size, not the MR page size. Use PAGE_SIZE instead of
+umem_odp->page_shift.
+
+Fixes: 403cd12e2cf7 ("IB/umem: Add contiguous ODP support")
+Link: https://lore.kernel.org/r/20191222124649.52300-3-leon@kernel.org
+Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
+Reviewed-by: Artemy Kovalyov <artemyko@mellanox.com>
+Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
+Signed-off-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/core/umem_odp.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/infiniband/core/umem_odp.c
++++ b/drivers/infiniband/core/umem_odp.c
+@@ -689,7 +689,7 @@ int ib_umem_odp_map_dma_pages(struct ib_
+       while (bcnt > 0) {
+               const size_t gup_num_pages = min_t(size_t,
+-                              (bcnt + BIT(page_shift) - 1) >> page_shift,
++                              ALIGN(bcnt, PAGE_SIZE) / PAGE_SIZE,
+                               PAGE_SIZE / sizeof(struct page *));
+               down_read(&owning_mm->mmap_sem);
diff --git a/queue-4.19/ib-mlx5-fix-outstanding_pi-index-for-gsi-qps.patch b/queue-4.19/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.19/nfsd-fix-delay-timer-on-32-bit-architectures.patch b/queue-4.19/nfsd-fix-delay-timer-on-32-bit-architectures.patch
new file mode 100644 (file)
index 0000000..f576b7e
--- /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
+@@ -676,7 +676,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.19/nfsd-fix-jiffies-time_t-mixup-in-lru-list.patch b/queue-4.19/nfsd-fix-jiffies-time_t-mixup-in-lru-list.patch
new file mode 100644 (file)
index 0000000..ba1c469
--- /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
+@@ -6075,7 +6075,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
+@@ -592,7 +592,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;
diff --git a/queue-4.19/nfsd-return-the-correct-number-of-bytes-written-to-the-file.patch b/queue-4.19/nfsd-return-the-correct-number-of-bytes-written-to-the-file.patch
new file mode 100644 (file)
index 0000000..7991f01
--- /dev/null
@@ -0,0 +1,31 @@
+From 09a80f2aef06b7c86143f5c14efd3485e0d2c139 Mon Sep 17 00:00:00 2001
+From: Trond Myklebust <trondmy@gmail.com>
+Date: Tue, 17 Dec 2019 12:33:33 -0500
+Subject: nfsd: Return the correct number of bytes written to the file
+
+From: Trond Myklebust <trondmy@gmail.com>
+
+commit 09a80f2aef06b7c86143f5c14efd3485e0d2c139 upstream.
+
+We must allow for the fact that iov_iter_write() could have returned
+a short write (e.g. if there was an ENOSPC issue).
+
+Fixes: d890be159a71 "nfsd: Add I/O trace points in the NFSv4 write path"
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Signed-off-by: J. Bruce Fields <bfields@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/nfsd/vfs.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/fs/nfsd/vfs.c
++++ b/fs/nfsd/vfs.c
+@@ -1016,6 +1016,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, s
+       host_err = vfs_iter_write(file, &iter, &pos, flags);
+       if (host_err < 0)
+               goto out_nfserr;
++      *cnt = host_err;
+       nfsdstats.io_write += *cnt;
+       fsnotify_modify(file);
index 9b82c0aa795daa834411baec532cd3a070456026..1e4b41a369462aea36568aa698051ea2284e9428 100644 (file)
@@ -154,3 +154,8 @@ 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
+ib-core-fix-odp-get-user-pages-flow.patch
+nfsd-fix-delay-timer-on-32-bit-architectures.patch
+nfsd-fix-jiffies-time_t-mixup-in-lru-list.patch
+nfsd-return-the-correct-number-of-bytes-written-to-the-file.patch