summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThorsten Leemhuis <fedora@leemhuis.info>2019-04-03 07:02:05 +0200
committerThorsten Leemhuis <fedora@leemhuis.info>2019-04-03 07:02:05 +0200
commit92b4aaa4d3ba5caf0b5ddb74f14ce75b2d94ff03 (patch)
treef7a2ae1ca4d63bd353f4bfbdd3401da7850ff907
parent81d70d4a3e0832feb835c0343685064ccfca71b5 (diff)
parent4e4c21031481e606c686fcb6cb2994b0199b1170 (diff)
downloadkernel-92b4aaa4d3ba5caf0b5ddb74f14ce75b2d94ff03.tar.gz
kernel-92b4aaa4d3ba5caf0b5ddb74f14ce75b2d94ff03.tar.xz
kernel-92b4aaa4d3ba5caf0b5ddb74f14ce75b2d94ff03.zip
Merge remote-tracking branch 'origin/f29' into f29-user-thl-vanilla-fedora
-rw-r--r--0001-inotify-Fix-fsnotify_mark-refcount-leak-in-inotify_u.patch45
-rw-r--r--configs/fedora/generic/CONFIG_IOSCHED_BFQ2
-rw-r--r--configs/fedora/generic/CONFIG_MQ_IOSCHED_KYBER2
-rw-r--r--kernel-aarch64-debug.config4
-rw-r--r--kernel-aarch64.config4
-rw-r--r--kernel-armv7hl-debug.config4
-rw-r--r--kernel-armv7hl-lpae-debug.config4
-rw-r--r--kernel-armv7hl-lpae.config4
-rw-r--r--kernel-armv7hl.config4
-rw-r--r--kernel-i686-debug.config4
-rw-r--r--kernel-i686.config4
-rw-r--r--kernel-ppc64le-debug.config4
-rw-r--r--kernel-ppc64le.config4
-rw-r--r--kernel-s390x-debug.config4
-rw-r--r--kernel-s390x.config4
-rw-r--r--kernel-x86_64-debug.config4
-rw-r--r--kernel-x86_64.config4
-rw-r--r--kernel.spec15
-rw-r--r--nfsv4.1-avoid-false-retries.patch527
19 files changed, 350 insertions, 297 deletions
diff --git a/0001-inotify-Fix-fsnotify_mark-refcount-leak-in-inotify_u.patch b/0001-inotify-Fix-fsnotify_mark-refcount-leak-in-inotify_u.patch
new file mode 100644
index 000000000..e0c6f73a3
--- /dev/null
+++ b/0001-inotify-Fix-fsnotify_mark-refcount-leak-in-inotify_u.patch
@@ -0,0 +1,45 @@
+From 62c9d2674b31d4c8a674bee86b7edc6da2803aea Mon Sep 17 00:00:00 2001
+From: ZhangXiaoxu <zhangxiaoxu5@huawei.com>
+Date: Sat, 2 Mar 2019 09:17:32 +0800
+Subject: [PATCH] inotify: Fix fsnotify_mark refcount leak in
+ inotify_update_existing_watch()
+
+Commit 4d97f7d53da7dc83 ("inotify: Add flag IN_MASK_CREATE for
+inotify_add_watch()") forgot to call fsnotify_put_mark() with
+IN_MASK_CREATE after fsnotify_find_mark()
+
+Fixes: 4d97f7d53da7dc83 ("inotify: Add flag IN_MASK_CREATE for inotify_add_watch()")
+Signed-off-by: ZhangXiaoxu <zhangxiaoxu5@huawei.com>
+Signed-off-by: Jan Kara <jack@suse.cz>
+---
+ fs/notify/inotify/inotify_user.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c
+index e2901fbb9f76..7b53598c8804 100644
+--- a/fs/notify/inotify/inotify_user.c
++++ b/fs/notify/inotify/inotify_user.c
+@@ -519,8 +519,10 @@ static int inotify_update_existing_watch(struct fsnotify_group *group,
+ fsn_mark = fsnotify_find_mark(&inode->i_fsnotify_marks, group);
+ if (!fsn_mark)
+ return -ENOENT;
+- else if (create)
+- return -EEXIST;
++ else if (create) {
++ ret = -EEXIST;
++ goto out;
++ }
+
+ i_mark = container_of(fsn_mark, struct inotify_inode_mark, fsn_mark);
+
+@@ -548,6 +550,7 @@ static int inotify_update_existing_watch(struct fsnotify_group *group,
+ /* return the wd */
+ ret = i_mark->wd;
+
++out:
+ /* match the get from fsnotify_find_mark() */
+ fsnotify_put_mark(fsn_mark);
+
+--
+2.20.1
+
diff --git a/configs/fedora/generic/CONFIG_IOSCHED_BFQ b/configs/fedora/generic/CONFIG_IOSCHED_BFQ
index 3023fb0b5..784fa4506 100644
--- a/configs/fedora/generic/CONFIG_IOSCHED_BFQ
+++ b/configs/fedora/generic/CONFIG_IOSCHED_BFQ
@@ -1 +1 @@
-CONFIG_IOSCHED_BFQ=m
+CONFIG_IOSCHED_BFQ=y
diff --git a/configs/fedora/generic/CONFIG_MQ_IOSCHED_KYBER b/configs/fedora/generic/CONFIG_MQ_IOSCHED_KYBER
index 939264da2..16623d2a0 100644
--- a/configs/fedora/generic/CONFIG_MQ_IOSCHED_KYBER
+++ b/configs/fedora/generic/CONFIG_MQ_IOSCHED_KYBER
@@ -1 +1 @@
-CONFIG_MQ_IOSCHED_KYBER=m
+CONFIG_MQ_IOSCHED_KYBER=y
diff --git a/kernel-aarch64-debug.config b/kernel-aarch64-debug.config
index be419e619..0e9483912 100644
--- a/kernel-aarch64-debug.config
+++ b/kernel-aarch64-debug.config
@@ -2489,7 +2489,7 @@ CONFIG_IOMMU_DMA=y
# CONFIG_IOMMU_IO_PGTABLE_LPAE_SELFTEST is not set
CONFIG_IOMMU_IO_PGTABLE_LPAE=y
CONFIG_IOMMU_SUPPORT=y
-CONFIG_IOSCHED_BFQ=m
+CONFIG_IOSCHED_BFQ=y
CONFIG_IO_STRICT_DEVMEM=y
CONFIG_IP6_NF_FILTER=m
CONFIG_IP6_NF_IPTABLES=m
@@ -3427,7 +3427,7 @@ CONFIG_MPLS_IPTUNNEL=m
CONFIG_MPLS_ROUTING=m
CONFIG_MPU3050_I2C=m
CONFIG_MQ_IOSCHED_DEADLINE=y
-CONFIG_MQ_IOSCHED_KYBER=m
+CONFIG_MQ_IOSCHED_KYBER=y
# CONFIG_MS5611 is not set
# CONFIG_MS5637 is not set
# CONFIG_MS_BLOCK is not set
diff --git a/kernel-aarch64.config b/kernel-aarch64.config
index 69a6dd91c..485abfaae 100644
--- a/kernel-aarch64.config
+++ b/kernel-aarch64.config
@@ -2473,7 +2473,7 @@ CONFIG_IOMMU_DMA=y
# CONFIG_IOMMU_IO_PGTABLE_LPAE_SELFTEST is not set
CONFIG_IOMMU_IO_PGTABLE_LPAE=y
CONFIG_IOMMU_SUPPORT=y
-CONFIG_IOSCHED_BFQ=m
+CONFIG_IOSCHED_BFQ=y
CONFIG_IO_STRICT_DEVMEM=y
CONFIG_IP6_NF_FILTER=m
CONFIG_IP6_NF_IPTABLES=m
@@ -3407,7 +3407,7 @@ CONFIG_MPLS_IPTUNNEL=m
CONFIG_MPLS_ROUTING=m
CONFIG_MPU3050_I2C=m
CONFIG_MQ_IOSCHED_DEADLINE=y
-CONFIG_MQ_IOSCHED_KYBER=m
+CONFIG_MQ_IOSCHED_KYBER=y
# CONFIG_MS5611 is not set
# CONFIG_MS5637 is not set
# CONFIG_MS_BLOCK is not set
diff --git a/kernel-armv7hl-debug.config b/kernel-armv7hl-debug.config
index 05e01d529..5ab95bed2 100644
--- a/kernel-armv7hl-debug.config
+++ b/kernel-armv7hl-debug.config
@@ -2556,7 +2556,7 @@ CONFIG_IOMMU_DMA=y
# CONFIG_IOMMU_IO_PGTABLE_LPAE_SELFTEST is not set
CONFIG_IOMMU_IO_PGTABLE_LPAE=y
CONFIG_IOMMU_SUPPORT=y
-CONFIG_IOSCHED_BFQ=m
+CONFIG_IOSCHED_BFQ=y
CONFIG_IO_STRICT_DEVMEM=y
CONFIG_IP6_NF_FILTER=m
CONFIG_IP6_NF_IPTABLES=m
@@ -3537,7 +3537,7 @@ CONFIG_MPLS_IPTUNNEL=m
CONFIG_MPLS_ROUTING=m
CONFIG_MPU3050_I2C=m
CONFIG_MQ_IOSCHED_DEADLINE=y
-CONFIG_MQ_IOSCHED_KYBER=m
+CONFIG_MQ_IOSCHED_KYBER=y
# CONFIG_MS5611 is not set
# CONFIG_MS5637 is not set
# CONFIG_MS_BLOCK is not set
diff --git a/kernel-armv7hl-lpae-debug.config b/kernel-armv7hl-lpae-debug.config
index b3f607dd2..cb7f7fc20 100644
--- a/kernel-armv7hl-lpae-debug.config
+++ b/kernel-armv7hl-lpae-debug.config
@@ -2443,7 +2443,7 @@ CONFIG_IOMMU_DMA=y
# CONFIG_IOMMU_IO_PGTABLE_LPAE_SELFTEST is not set
CONFIG_IOMMU_IO_PGTABLE_LPAE=y
CONFIG_IOMMU_SUPPORT=y
-CONFIG_IOSCHED_BFQ=m
+CONFIG_IOSCHED_BFQ=y
CONFIG_IO_STRICT_DEVMEM=y
CONFIG_IP6_NF_FILTER=m
CONFIG_IP6_NF_IPTABLES=m
@@ -3397,7 +3397,7 @@ CONFIG_MPLS_IPTUNNEL=m
CONFIG_MPLS_ROUTING=m
CONFIG_MPU3050_I2C=m
CONFIG_MQ_IOSCHED_DEADLINE=y
-CONFIG_MQ_IOSCHED_KYBER=m
+CONFIG_MQ_IOSCHED_KYBER=y
# CONFIG_MS5611 is not set
# CONFIG_MS5637 is not set
# CONFIG_MS_BLOCK is not set
diff --git a/kernel-armv7hl-lpae.config b/kernel-armv7hl-lpae.config
index c789bf878..8d50206d7 100644
--- a/kernel-armv7hl-lpae.config
+++ b/kernel-armv7hl-lpae.config
@@ -2428,7 +2428,7 @@ CONFIG_IOMMU_DMA=y
# CONFIG_IOMMU_IO_PGTABLE_LPAE_SELFTEST is not set
CONFIG_IOMMU_IO_PGTABLE_LPAE=y
CONFIG_IOMMU_SUPPORT=y
-CONFIG_IOSCHED_BFQ=m
+CONFIG_IOSCHED_BFQ=y
CONFIG_IO_STRICT_DEVMEM=y
CONFIG_IP6_NF_FILTER=m
CONFIG_IP6_NF_IPTABLES=m
@@ -3378,7 +3378,7 @@ CONFIG_MPLS_IPTUNNEL=m
CONFIG_MPLS_ROUTING=m
CONFIG_MPU3050_I2C=m
CONFIG_MQ_IOSCHED_DEADLINE=y
-CONFIG_MQ_IOSCHED_KYBER=m
+CONFIG_MQ_IOSCHED_KYBER=y
# CONFIG_MS5611 is not set
# CONFIG_MS5637 is not set
# CONFIG_MS_BLOCK is not set
diff --git a/kernel-armv7hl.config b/kernel-armv7hl.config
index 3009816db..01c667a48 100644
--- a/kernel-armv7hl.config
+++ b/kernel-armv7hl.config
@@ -2541,7 +2541,7 @@ CONFIG_IOMMU_DMA=y
# CONFIG_IOMMU_IO_PGTABLE_LPAE_SELFTEST is not set
CONFIG_IOMMU_IO_PGTABLE_LPAE=y
CONFIG_IOMMU_SUPPORT=y
-CONFIG_IOSCHED_BFQ=m
+CONFIG_IOSCHED_BFQ=y
CONFIG_IO_STRICT_DEVMEM=y
CONFIG_IP6_NF_FILTER=m
CONFIG_IP6_NF_IPTABLES=m
@@ -3518,7 +3518,7 @@ CONFIG_MPLS_IPTUNNEL=m
CONFIG_MPLS_ROUTING=m
CONFIG_MPU3050_I2C=m
CONFIG_MQ_IOSCHED_DEADLINE=y
-CONFIG_MQ_IOSCHED_KYBER=m
+CONFIG_MQ_IOSCHED_KYBER=y
# CONFIG_MS5611 is not set
# CONFIG_MS5637 is not set
# CONFIG_MS_BLOCK is not set
diff --git a/kernel-i686-debug.config b/kernel-i686-debug.config
index b1402dfdd..9c0b17f5b 100644
--- a/kernel-i686-debug.config
+++ b/kernel-i686-debug.config
@@ -2304,7 +2304,7 @@ CONFIG_IO_DELAY_0X80=y
CONFIG_IOMMU_DEBUGFS=y
# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set
CONFIG_IOMMU_SUPPORT=y
-CONFIG_IOSCHED_BFQ=m
+CONFIG_IOSCHED_BFQ=y
# CONFIG_IOSF_MBI_DEBUG is not set
CONFIG_IOSF_MBI=y
CONFIG_IO_STRICT_DEVMEM=y
@@ -3220,7 +3220,7 @@ CONFIG_MPLS_IPTUNNEL=m
CONFIG_MPLS_ROUTING=m
CONFIG_MPU3050_I2C=m
CONFIG_MQ_IOSCHED_DEADLINE=y
-CONFIG_MQ_IOSCHED_KYBER=m
+CONFIG_MQ_IOSCHED_KYBER=y
# CONFIG_MS5611 is not set
# CONFIG_MS5637 is not set
# CONFIG_MS_BLOCK is not set
diff --git a/kernel-i686.config b/kernel-i686.config
index c7240332a..3ae262491 100644
--- a/kernel-i686.config
+++ b/kernel-i686.config
@@ -2287,7 +2287,7 @@ CONFIG_IO_DELAY_0X80=y
# CONFIG_IOMMU_DEBUGFS is not set
# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set
CONFIG_IOMMU_SUPPORT=y
-CONFIG_IOSCHED_BFQ=m
+CONFIG_IOSCHED_BFQ=y
# CONFIG_IOSF_MBI_DEBUG is not set
CONFIG_IOSF_MBI=y
CONFIG_IO_STRICT_DEVMEM=y
@@ -3201,7 +3201,7 @@ CONFIG_MPLS_IPTUNNEL=m
CONFIG_MPLS_ROUTING=m
CONFIG_MPU3050_I2C=m
CONFIG_MQ_IOSCHED_DEADLINE=y
-CONFIG_MQ_IOSCHED_KYBER=m
+CONFIG_MQ_IOSCHED_KYBER=y
# CONFIG_MS5611 is not set
# CONFIG_MS5637 is not set
# CONFIG_MS_BLOCK is not set
diff --git a/kernel-ppc64le-debug.config b/kernel-ppc64le-debug.config
index 5b9b68f07..328ac18d2 100644
--- a/kernel-ppc64le-debug.config
+++ b/kernel-ppc64le-debug.config
@@ -2075,7 +2075,7 @@ CONFIG_IO_EVENT_IRQ=y
CONFIG_IOMMU_DEBUGFS=y
# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set
CONFIG_IOMMU_SUPPORT=y
-CONFIG_IOSCHED_BFQ=m
+CONFIG_IOSCHED_BFQ=y
CONFIG_IO_STRICT_DEVMEM=y
CONFIG_IP6_NF_FILTER=m
CONFIG_IP6_NF_IPTABLES=m
@@ -2959,7 +2959,7 @@ CONFIG_MPLS_IPTUNNEL=m
CONFIG_MPLS_ROUTING=m
CONFIG_MPU3050_I2C=m
CONFIG_MQ_IOSCHED_DEADLINE=y
-CONFIG_MQ_IOSCHED_KYBER=m
+CONFIG_MQ_IOSCHED_KYBER=y
# CONFIG_MS5611 is not set
# CONFIG_MS5637 is not set
# CONFIG_MS_BLOCK is not set
diff --git a/kernel-ppc64le.config b/kernel-ppc64le.config
index 97b21565e..2eb7ac949 100644
--- a/kernel-ppc64le.config
+++ b/kernel-ppc64le.config
@@ -2058,7 +2058,7 @@ CONFIG_IO_EVENT_IRQ=y
# CONFIG_IOMMU_DEBUGFS is not set
# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set
CONFIG_IOMMU_SUPPORT=y
-CONFIG_IOSCHED_BFQ=m
+CONFIG_IOSCHED_BFQ=y
CONFIG_IO_STRICT_DEVMEM=y
CONFIG_IP6_NF_FILTER=m
CONFIG_IP6_NF_IPTABLES=m
@@ -2938,7 +2938,7 @@ CONFIG_MPLS_IPTUNNEL=m
CONFIG_MPLS_ROUTING=m
CONFIG_MPU3050_I2C=m
CONFIG_MQ_IOSCHED_DEADLINE=y
-CONFIG_MQ_IOSCHED_KYBER=m
+CONFIG_MQ_IOSCHED_KYBER=y
# CONFIG_MS5611 is not set
# CONFIG_MS5637 is not set
# CONFIG_MS_BLOCK is not set
diff --git a/kernel-s390x-debug.config b/kernel-s390x-debug.config
index c978c1bae..f175bd115 100644
--- a/kernel-s390x-debug.config
+++ b/kernel-s390x-debug.config
@@ -2054,7 +2054,7 @@ CONFIG_IO_DELAY_0X80=y
CONFIG_IOMMU_DEBUGFS=y
# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set
CONFIG_IOMMU_SUPPORT=y
-CONFIG_IOSCHED_BFQ=m
+CONFIG_IOSCHED_BFQ=y
CONFIG_IO_STRICT_DEVMEM=y
CONFIG_IP6_NF_FILTER=m
CONFIG_IP6_NF_IPTABLES=m
@@ -2933,7 +2933,7 @@ CONFIG_MPLS_IPTUNNEL=m
CONFIG_MPLS_ROUTING=m
CONFIG_MPU3050_I2C=m
CONFIG_MQ_IOSCHED_DEADLINE=y
-CONFIG_MQ_IOSCHED_KYBER=m
+CONFIG_MQ_IOSCHED_KYBER=y
# CONFIG_MS5611 is not set
# CONFIG_MS5637 is not set
# CONFIG_MS_BLOCK is not set
diff --git a/kernel-s390x.config b/kernel-s390x.config
index 4dd57ce6c..c401340cf 100644
--- a/kernel-s390x.config
+++ b/kernel-s390x.config
@@ -2037,7 +2037,7 @@ CONFIG_IO_DELAY_0X80=y
# CONFIG_IOMMU_DEBUGFS is not set
# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set
CONFIG_IOMMU_SUPPORT=y
-CONFIG_IOSCHED_BFQ=m
+CONFIG_IOSCHED_BFQ=y
CONFIG_IO_STRICT_DEVMEM=y
CONFIG_IP6_NF_FILTER=m
CONFIG_IP6_NF_IPTABLES=m
@@ -2912,7 +2912,7 @@ CONFIG_MPLS_IPTUNNEL=m
CONFIG_MPLS_ROUTING=m
CONFIG_MPU3050_I2C=m
CONFIG_MQ_IOSCHED_DEADLINE=y
-CONFIG_MQ_IOSCHED_KYBER=m
+CONFIG_MQ_IOSCHED_KYBER=y
# CONFIG_MS5611 is not set
# CONFIG_MS5637 is not set
# CONFIG_MS_BLOCK is not set
diff --git a/kernel-x86_64-debug.config b/kernel-x86_64-debug.config
index e354f55f2..072e8fc8d 100644
--- a/kernel-x86_64-debug.config
+++ b/kernel-x86_64-debug.config
@@ -2348,7 +2348,7 @@ CONFIG_IO_DELAY_0X80=y
CONFIG_IOMMU_DEBUGFS=y
# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set
CONFIG_IOMMU_SUPPORT=y
-CONFIG_IOSCHED_BFQ=m
+CONFIG_IOSCHED_BFQ=y
# CONFIG_IOSF_MBI_DEBUG is not set
CONFIG_IOSF_MBI=y
CONFIG_IO_STRICT_DEVMEM=y
@@ -3256,7 +3256,7 @@ CONFIG_MPLS_ROUTING=m
# CONFIG_MPSC is not set
CONFIG_MPU3050_I2C=m
CONFIG_MQ_IOSCHED_DEADLINE=y
-CONFIG_MQ_IOSCHED_KYBER=m
+CONFIG_MQ_IOSCHED_KYBER=y
# CONFIG_MS5611 is not set
# CONFIG_MS5637 is not set
# CONFIG_MS_BLOCK is not set
diff --git a/kernel-x86_64.config b/kernel-x86_64.config
index 16625c7f5..1f85a3d02 100644
--- a/kernel-x86_64.config
+++ b/kernel-x86_64.config
@@ -2331,7 +2331,7 @@ CONFIG_IO_DELAY_0X80=y
# CONFIG_IOMMU_DEBUGFS is not set
# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set
CONFIG_IOMMU_SUPPORT=y
-CONFIG_IOSCHED_BFQ=m
+CONFIG_IOSCHED_BFQ=y
# CONFIG_IOSF_MBI_DEBUG is not set
CONFIG_IOSF_MBI=y
CONFIG_IO_STRICT_DEVMEM=y
@@ -3237,7 +3237,7 @@ CONFIG_MPLS_ROUTING=m
# CONFIG_MPSC is not set
CONFIG_MPU3050_I2C=m
CONFIG_MQ_IOSCHED_DEADLINE=y
-CONFIG_MQ_IOSCHED_KYBER=m
+CONFIG_MQ_IOSCHED_KYBER=y
# CONFIG_MS5611 is not set
# CONFIG_MS5637 is not set
# CONFIG_MS_BLOCK is not set
diff --git a/kernel.spec b/kernel.spec
index 9480a12eb..e46555b7e 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -625,6 +625,12 @@ Patch513: 0001-virt-vbox-Implement-passing-requestor-info-to-the-ho.patch
# rhbz 1688283
Patch514: v3-tpm-fix-an-invalid-condition-in-tpm_common_poll.patch
+# rhbz 1683382
+Patch515: nfsv4.1-avoid-false-retries.patch
+
+# CVE-2019-9857 rhbz 1694758 1694759
+Patch516: 0001-inotify-Fix-fsnotify_mark-refcount-leak-in-inotify_u.patch
+
# END OF PATCH DEFINITIONS
%endif
@@ -1901,6 +1907,15 @@ fi
#
#
%changelog
+* Mon Apr 01 2019 Justin M. Forbes <jforbes@fedoraproject.org>
+- Fix CVE-2019-9857 (rhbz 1694758 1694759)
+
+* Mon Apr 01 2019 Laura Abbott <labbott@redhat.com>
+- Ensure ioschedulers are built in (rhbz 1690604)
+
+* Wed Mar 27 2019 Laura Abbott <labbott@redhat.com> - 5.0.5-200
+- Linux v5.0.5
+
* Mon Mar 25 2019 Laura Abbott <labbott@redhat.com> - 5.0.4-200
- Linux v5.0.4
diff --git a/nfsv4.1-avoid-false-retries.patch b/nfsv4.1-avoid-false-retries.patch
index b136df0e7..ebec54dab 100644
--- a/nfsv4.1-avoid-false-retries.patch
+++ b/nfsv4.1-avoid-false-retries.patch
@@ -1,267 +1,260 @@
-From d72ad5fe4c2206458d127cc31e690318cf2e2731 Mon Sep 17 00:00:00 2001
-From: Trond Myklebust <trond.myklebust@hammerspace.com>
-Date: Wed, 20 Jun 2018 17:53:34 -0400
-Subject: [PATCH] NFSv4.1: Avoid false retries when RPC calls are interrupted
-
-A 'false retry' in NFSv4.1 occurs when the client attempts to transmit a
-new RPC call using a slot+sequence number combination that references an
-already cached one. Currently, the Linux NFS client will do this if a
-user process interrupts an RPC call that is in progress.
-The problem with doing so is that we defeat the main mechanism used by
-the server to differentiate between a new call and a replayed one. Even
-if the server is able to perfectly cache the arguments of the old call,
-it cannot know if the client intended to replay or send a new call.
-
-The obvious fix is to bump the sequence number pre-emptively if an
-RPC call is interrupted, but in order to deal with the corner cases
-where the interrupted call is not actually received and processed by
-the server, we need to interpret the error NFS4ERR_SEQ_MISORDERED
-as a sign that we need to either wait or locate a correct sequence
-number that lies between the value we sent, and the last value that
-was acked by a SEQUENCE call on that slot.
-
-Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
----
- fs/nfs/nfs4proc.c | 105 ++++++++++++++++++++-----------------------
- fs/nfs/nfs4session.c | 5 ++-
- fs/nfs/nfs4session.h | 5 ++-
- 3 files changed, 55 insertions(+), 60 deletions(-)
-
-diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
-index 867457d..c11e059 100644
---- a/fs/nfs/nfs4proc.c
-+++ b/fs/nfs/nfs4proc.c
-@@ -730,13 +730,25 @@ static void nfs41_sequence_free_slot(struct nfs4_sequence_res *res)
- res->sr_slot = NULL;
- }
-
-+static void nfs4_slot_sequence_record_sent(struct nfs4_slot *slot,
-+ u32 seqnr)
-+{
-+ if ((s32)(seqnr - slot->seq_nr_highest_sent) > 0)
-+ slot->seq_nr_highest_sent = seqnr;
-+}
-+static void nfs4_slot_sequence_acked(struct nfs4_slot *slot,
-+ u32 seqnr)
-+{
-+ slot->seq_nr_highest_sent = seqnr;
-+ slot->seq_nr_last_acked = seqnr;
-+}
-+
- static int nfs41_sequence_process(struct rpc_task *task,
- struct nfs4_sequence_res *res)
- {
- struct nfs4_session *session;
- struct nfs4_slot *slot = res->sr_slot;
- struct nfs_client *clp;
-- bool interrupted = false;
- int ret = 1;
-
- if (slot == NULL)
-@@ -747,16 +759,12 @@ static int nfs41_sequence_process(struct rpc_task *task,
-
- session = slot->table->session;
-
-- if (slot->interrupted) {
-- if (res->sr_status != -NFS4ERR_DELAY)
-- slot->interrupted = 0;
-- interrupted = true;
-- }
--
- trace_nfs4_sequence_done(session, res);
- /* Check the SEQUENCE operation status */
- switch (res->sr_status) {
- case 0:
-+ /* Mark this sequence number as having been acked */
-+ nfs4_slot_sequence_acked(slot, slot->seq_nr);
- /* Update the slot's sequence and clientid lease timer */
- slot->seq_done = 1;
- clp = session->clp;
-@@ -771,9 +779,9 @@ static int nfs41_sequence_process(struct rpc_task *task,
- * sr_status remains 1 if an RPC level error occurred.
- * The server may or may not have processed the sequence
- * operation..
-- * Mark the slot as having hosted an interrupted RPC call.
- */
-- slot->interrupted = 1;
-+ nfs4_slot_sequence_record_sent(slot, slot->seq_nr);
-+ slot->seq_done = 1;
- goto out;
- case -NFS4ERR_DELAY:
- /* The server detected a resend of the RPC call and
-@@ -784,6 +792,7 @@ static int nfs41_sequence_process(struct rpc_task *task,
- __func__,
- slot->slot_nr,
- slot->seq_nr);
-+ nfs4_slot_sequence_acked(slot, slot->seq_nr);
- goto out_retry;
- case -NFS4ERR_RETRY_UNCACHED_REP:
- case -NFS4ERR_SEQ_FALSE_RETRY:
-@@ -791,6 +800,7 @@ static int nfs41_sequence_process(struct rpc_task *task,
- * The server thinks we tried to replay a request.
- * Retry the call after bumping the sequence ID.
- */
-+ nfs4_slot_sequence_acked(slot, slot->seq_nr);
- goto retry_new_seq;
- case -NFS4ERR_BADSLOT:
- /*
-@@ -801,21 +811,28 @@ static int nfs41_sequence_process(struct rpc_task *task,
- goto session_recover;
- goto retry_nowait;
- case -NFS4ERR_SEQ_MISORDERED:
-+ nfs4_slot_sequence_record_sent(slot, slot->seq_nr);
- /*
-- * Was the last operation on this sequence interrupted?
-- * If so, retry after bumping the sequence number.
-+ * Were one or more calls using this slot interrupted?
-+ * If the server never received the request, then our
-+ * transmitted slot sequence number may be too high.
- */
-- if (interrupted)
-- goto retry_new_seq;
-- /*
-- * Could this slot have been previously retired?
-- * If so, then the server may be expecting seq_nr = 1!
-- */
-- if (slot->seq_nr != 1) {
-- slot->seq_nr = 1;
-+ if ((s32)(slot->seq_nr - slot->seq_nr_last_acked) > 1) {
-+ slot->seq_nr--;
- goto retry_nowait;
- }
-- goto session_recover;
-+ /*
-+ * RFC5661:
-+ * A retry might be sent while the original request is
-+ * still in progress on the replier. The replier SHOULD
-+ * deal with the issue by returning NFS4ERR_DELAY as the
-+ * reply to SEQUENCE or CB_SEQUENCE operation, but
-+ * implementations MAY return NFS4ERR_SEQ_MISORDERED.
-+ *
-+ * Restart the search after a delay.
-+ */
-+ slot->seq_nr = slot->seq_nr_highest_sent;
-+ goto out_retry;
- default:
- /* Just update the slot sequence no. */
- slot->seq_done = 1;
-@@ -906,17 +923,6 @@ static const struct rpc_call_ops nfs41_call_sync_ops = {
- .rpc_call_done = nfs41_call_sync_done,
- };
-
--static void
--nfs4_sequence_process_interrupted(struct nfs_client *client,
-- struct nfs4_slot *slot, struct rpc_cred *cred)
--{
-- struct rpc_task *task;
--
-- task = _nfs41_proc_sequence(client, cred, slot, true);
-- if (!IS_ERR(task))
-- rpc_put_task_async(task);
--}
--
- #else /* !CONFIG_NFS_V4_1 */
-
- static int nfs4_sequence_process(struct rpc_task *task, struct nfs4_sequence_res *res)
-@@ -937,14 +943,6 @@ int nfs4_sequence_done(struct rpc_task *task,
- }
- EXPORT_SYMBOL_GPL(nfs4_sequence_done);
-
--static void
--nfs4_sequence_process_interrupted(struct nfs_client *client,
-- struct nfs4_slot *slot, struct rpc_cred *cred)
--{
-- WARN_ON_ONCE(1);
-- slot->interrupted = 0;
--}
--
- #endif /* !CONFIG_NFS_V4_1 */
-
- static
-@@ -982,26 +980,19 @@ int nfs4_setup_sequence(struct nfs_client *client,
- task->tk_timeout = 0;
- }
-
-- for (;;) {
-- spin_lock(&tbl->slot_tbl_lock);
-- /* The state manager will wait until the slot table is empty */
-- if (nfs4_slot_tbl_draining(tbl) && !args->sa_privileged)
-- goto out_sleep;
--
-- slot = nfs4_alloc_slot(tbl);
-- if (IS_ERR(slot)) {
-- /* Try again in 1/4 second */
-- if (slot == ERR_PTR(-ENOMEM))
-- task->tk_timeout = HZ >> 2;
-- goto out_sleep;
-- }
-- spin_unlock(&tbl->slot_tbl_lock);
-+ spin_lock(&tbl->slot_tbl_lock);
-+ /* The state manager will wait until the slot table is empty */
-+ if (nfs4_slot_tbl_draining(tbl) && !args->sa_privileged)
-+ goto out_sleep;
-
-- if (likely(!slot->interrupted))
-- break;
-- nfs4_sequence_process_interrupted(client,
-- slot, task->tk_msg.rpc_cred);
-+ slot = nfs4_alloc_slot(tbl);
-+ if (IS_ERR(slot)) {
-+ /* Try again in 1/4 second */
-+ if (slot == ERR_PTR(-ENOMEM))
-+ task->tk_timeout = HZ >> 2;
-+ goto out_sleep;
- }
-+ spin_unlock(&tbl->slot_tbl_lock);
-
- nfs4_sequence_attach_slot(args, res, slot);
-
-diff --git a/fs/nfs/nfs4session.c b/fs/nfs/nfs4session.c
-index 769b856..fdb75da 100644
---- a/fs/nfs/nfs4session.c
-+++ b/fs/nfs/nfs4session.c
-@@ -110,6 +110,8 @@ static struct nfs4_slot *nfs4_new_slot(struct nfs4_slot_table *tbl,
- slot->table = tbl;
- slot->slot_nr = slotid;
- slot->seq_nr = seq_init;
-+ slot->seq_nr_highest_sent = seq_init;
-+ slot->seq_nr_last_acked = seq_init - 1;
- }
- return slot;
- }
-@@ -276,7 +278,8 @@ static void nfs4_reset_slot_table(struct nfs4_slot_table *tbl,
- p = &tbl->slots;
- while (*p) {
- (*p)->seq_nr = ivalue;
-- (*p)->interrupted = 0;
-+ (*p)->seq_nr_highest_sent = ivalue;
-+ (*p)->seq_nr_last_acked = ivalue - 1;
- p = &(*p)->next;
- }
- tbl->highest_used_slotid = NFS4_NO_SLOT;
-diff --git a/fs/nfs/nfs4session.h b/fs/nfs/nfs4session.h
-index 3c550f2..230509b 100644
---- a/fs/nfs/nfs4session.h
-+++ b/fs/nfs/nfs4session.h
-@@ -23,8 +23,9 @@ struct nfs4_slot {
- unsigned long generation;
- u32 slot_nr;
- u32 seq_nr;
-- unsigned int interrupted : 1,
-- privileged : 1,
-+ u32 seq_nr_last_acked;
-+ u32 seq_nr_highest_sent;
-+ unsigned int privileged : 1,
- seq_done : 1;
- };
-
---
-2.20.1
-
---
-Trond Myklebust
-Linux NFS client maintainer, Hammerspace
-trond.myklebust@hammerspace.com
-
-
-
+From 675f11241a9f5b434effc7aee9eb84bf3d17d685 Mon Sep 17 00:00:00 2001
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+Date: Wed, 20 Jun 2018 17:53:34 -0400
+Subject: [PATCH] NFSv4.1: Avoid false retries when RPC calls are interrupted
+
+A 'false retry' in NFSv4.1 occurs when the client attempts to transmit a
+new RPC call using a slot+sequence number combination that references an
+already cached one. Currently, the Linux NFS client will do this if a
+user process interrupts an RPC call that is in progress.
+The problem with doing so is that we defeat the main mechanism used by
+the server to differentiate between a new call and a replayed one. Even
+if the server is able to perfectly cache the arguments of the old call,
+it cannot know if the client intended to replay or send a new call.
+
+The obvious fix is to bump the sequence number pre-emptively if an
+RPC call is interrupted, but in order to deal with the corner cases
+where the interrupted call is not actually received and processed by
+the server, we need to interpret the error NFS4ERR_SEQ_MISORDERED
+as a sign that we need to either wait or locate a correct sequence
+number that lies between the value we sent, and the last value that
+was acked by a SEQUENCE call on that slot.
+
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+---
+ fs/nfs/nfs4proc.c | 105 ++++++++++++++++++++-----------------------
+ fs/nfs/nfs4session.c | 5 ++-
+ fs/nfs/nfs4session.h | 5 ++-
+ 3 files changed, 55 insertions(+), 60 deletions(-)
+
+diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
+index 64ac80ec6b7b..3a6a9c9ee369 100644
+--- a/fs/nfs/nfs4proc.c
++++ b/fs/nfs/nfs4proc.c
+@@ -730,13 +730,25 @@ static void nfs41_sequence_free_slot(struct nfs4_sequence_res *res)
+ res->sr_slot = NULL;
+ }
+
++static void nfs4_slot_sequence_record_sent(struct nfs4_slot *slot,
++ u32 seqnr)
++{
++ if ((s32)(seqnr - slot->seq_nr_highest_sent) > 0)
++ slot->seq_nr_highest_sent = seqnr;
++}
++static void nfs4_slot_sequence_acked(struct nfs4_slot *slot,
++ u32 seqnr)
++{
++ slot->seq_nr_highest_sent = seqnr;
++ slot->seq_nr_last_acked = seqnr;
++}
++
+ static int nfs41_sequence_process(struct rpc_task *task,
+ struct nfs4_sequence_res *res)
+ {
+ struct nfs4_session *session;
+ struct nfs4_slot *slot = res->sr_slot;
+ struct nfs_client *clp;
+- bool interrupted = false;
+ int ret = 1;
+
+ if (slot == NULL)
+@@ -747,16 +759,12 @@ static int nfs41_sequence_process(struct rpc_task *task,
+
+ session = slot->table->session;
+
+- if (slot->interrupted) {
+- if (res->sr_status != -NFS4ERR_DELAY)
+- slot->interrupted = 0;
+- interrupted = true;
+- }
+-
+ trace_nfs4_sequence_done(session, res);
+ /* Check the SEQUENCE operation status */
+ switch (res->sr_status) {
+ case 0:
++ /* Mark this sequence number as having been acked */
++ nfs4_slot_sequence_acked(slot, slot->seq_nr);
+ /* Update the slot's sequence and clientid lease timer */
+ slot->seq_done = 1;
+ clp = session->clp;
+@@ -771,9 +779,9 @@ static int nfs41_sequence_process(struct rpc_task *task,
+ * sr_status remains 1 if an RPC level error occurred.
+ * The server may or may not have processed the sequence
+ * operation..
+- * Mark the slot as having hosted an interrupted RPC call.
+ */
+- slot->interrupted = 1;
++ nfs4_slot_sequence_record_sent(slot, slot->seq_nr);
++ slot->seq_done = 1;
+ goto out;
+ case -NFS4ERR_DELAY:
+ /* The server detected a resend of the RPC call and
+@@ -784,6 +792,7 @@ static int nfs41_sequence_process(struct rpc_task *task,
+ __func__,
+ slot->slot_nr,
+ slot->seq_nr);
++ nfs4_slot_sequence_acked(slot, slot->seq_nr);
+ goto out_retry;
+ case -NFS4ERR_RETRY_UNCACHED_REP:
+ case -NFS4ERR_SEQ_FALSE_RETRY:
+@@ -791,6 +800,7 @@ static int nfs41_sequence_process(struct rpc_task *task,
+ * The server thinks we tried to replay a request.
+ * Retry the call after bumping the sequence ID.
+ */
++ nfs4_slot_sequence_acked(slot, slot->seq_nr);
+ goto retry_new_seq;
+ case -NFS4ERR_BADSLOT:
+ /*
+@@ -801,21 +811,28 @@ static int nfs41_sequence_process(struct rpc_task *task,
+ goto session_recover;
+ goto retry_nowait;
+ case -NFS4ERR_SEQ_MISORDERED:
++ nfs4_slot_sequence_record_sent(slot, slot->seq_nr);
+ /*
+- * Was the last operation on this sequence interrupted?
+- * If so, retry after bumping the sequence number.
++ * Were one or more calls using this slot interrupted?
++ * If the server never received the request, then our
++ * transmitted slot sequence number may be too high.
+ */
+- if (interrupted)
+- goto retry_new_seq;
+- /*
+- * Could this slot have been previously retired?
+- * If so, then the server may be expecting seq_nr = 1!
+- */
+- if (slot->seq_nr != 1) {
+- slot->seq_nr = 1;
++ if ((s32)(slot->seq_nr - slot->seq_nr_last_acked) > 1) {
++ slot->seq_nr--;
+ goto retry_nowait;
+ }
+- goto session_recover;
++ /*
++ * RFC5661:
++ * A retry might be sent while the original request is
++ * still in progress on the replier. The replier SHOULD
++ * deal with the issue by returning NFS4ERR_DELAY as the
++ * reply to SEQUENCE or CB_SEQUENCE operation, but
++ * implementations MAY return NFS4ERR_SEQ_MISORDERED.
++ *
++ * Restart the search after a delay.
++ */
++ slot->seq_nr = slot->seq_nr_highest_sent;
++ goto out_retry;
+ default:
+ /* Just update the slot sequence no. */
+ slot->seq_done = 1;
+@@ -906,17 +923,6 @@ static const struct rpc_call_ops nfs41_call_sync_ops = {
+ .rpc_call_done = nfs41_call_sync_done,
+ };
+
+-static void
+-nfs4_sequence_process_interrupted(struct nfs_client *client,
+- struct nfs4_slot *slot, const struct cred *cred)
+-{
+- struct rpc_task *task;
+-
+- task = _nfs41_proc_sequence(client, cred, slot, true);
+- if (!IS_ERR(task))
+- rpc_put_task_async(task);
+-}
+-
+ #else /* !CONFIG_NFS_V4_1 */
+
+ static int nfs4_sequence_process(struct rpc_task *task, struct nfs4_sequence_res *res)
+@@ -937,14 +943,6 @@ int nfs4_sequence_done(struct rpc_task *task,
+ }
+ EXPORT_SYMBOL_GPL(nfs4_sequence_done);
+
+-static void
+-nfs4_sequence_process_interrupted(struct nfs_client *client,
+- struct nfs4_slot *slot, const struct cred *cred)
+-{
+- WARN_ON_ONCE(1);
+- slot->interrupted = 0;
+-}
+-
+ #endif /* !CONFIG_NFS_V4_1 */
+
+ static void nfs41_sequence_res_init(struct nfs4_sequence_res *res)
+@@ -985,26 +983,19 @@ int nfs4_setup_sequence(struct nfs_client *client,
+ task->tk_timeout = 0;
+ }
+
+- for (;;) {
+- spin_lock(&tbl->slot_tbl_lock);
+- /* The state manager will wait until the slot table is empty */
+- if (nfs4_slot_tbl_draining(tbl) && !args->sa_privileged)
+- goto out_sleep;
+-
+- slot = nfs4_alloc_slot(tbl);
+- if (IS_ERR(slot)) {
+- /* Try again in 1/4 second */
+- if (slot == ERR_PTR(-ENOMEM))
+- task->tk_timeout = HZ >> 2;
+- goto out_sleep;
+- }
+- spin_unlock(&tbl->slot_tbl_lock);
++ spin_lock(&tbl->slot_tbl_lock);
++ /* The state manager will wait until the slot table is empty */
++ if (nfs4_slot_tbl_draining(tbl) && !args->sa_privileged)
++ goto out_sleep;
+
+- if (likely(!slot->interrupted))
+- break;
+- nfs4_sequence_process_interrupted(client,
+- slot, task->tk_msg.rpc_cred);
++ slot = nfs4_alloc_slot(tbl);
++ if (IS_ERR(slot)) {
++ /* Try again in 1/4 second */
++ if (slot == ERR_PTR(-ENOMEM))
++ task->tk_timeout = HZ >> 2;
++ goto out_sleep;
+ }
++ spin_unlock(&tbl->slot_tbl_lock);
+
+ nfs4_sequence_attach_slot(args, res, slot);
+
+diff --git a/fs/nfs/nfs4session.c b/fs/nfs/nfs4session.c
+index a5489d70a724..39962c19744f 100644
+--- a/fs/nfs/nfs4session.c
++++ b/fs/nfs/nfs4session.c
+@@ -110,6 +110,8 @@ static struct nfs4_slot *nfs4_new_slot(struct nfs4_slot_table *tbl,
+ slot->table = tbl;
+ slot->slot_nr = slotid;
+ slot->seq_nr = seq_init;
++ slot->seq_nr_highest_sent = seq_init;
++ slot->seq_nr_last_acked = seq_init - 1;
+ }
+ return slot;
+ }
+@@ -276,7 +278,8 @@ static void nfs4_reset_slot_table(struct nfs4_slot_table *tbl,
+ p = &tbl->slots;
+ while (*p) {
+ (*p)->seq_nr = ivalue;
+- (*p)->interrupted = 0;
++ (*p)->seq_nr_highest_sent = ivalue;
++ (*p)->seq_nr_last_acked = ivalue - 1;
+ p = &(*p)->next;
+ }
+ tbl->highest_used_slotid = NFS4_NO_SLOT;
+diff --git a/fs/nfs/nfs4session.h b/fs/nfs/nfs4session.h
+index 3c550f297561..230509b77121 100644
+--- a/fs/nfs/nfs4session.h
++++ b/fs/nfs/nfs4session.h
+@@ -23,8 +23,9 @@ struct nfs4_slot {
+ unsigned long generation;
+ u32 slot_nr;
+ u32 seq_nr;
+- unsigned int interrupted : 1,
+- privileged : 1,
++ u32 seq_nr_last_acked;
++ u32 seq_nr_highest_sent;
++ unsigned int privileged : 1,
+ seq_done : 1;
+ };
+
+--
+2.20.1
+