Home Home > GIT Browse > SLE15-SP1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuis Henriques <lhenriques@suse.com>2019-01-16 16:12:01 +0000
committerLuis Henriques <lhenriques@suse.com>2019-01-18 11:21:09 +0000
commita522a2d7fb30b9752a75585cb12cf396ba44c000 (patch)
tree1839ec3d99ff94083820de05be1255b321fe840c
parenta9c2b67ed6bd71ec8d88fc21aa972ed335493a5d (diff)
ceph: skip updating 'wanted' caps if caps are already issued
(bsc#1122215).
-rw-r--r--patches.suse/ceph-skip-updating-wanted-caps-if-caps-are-already-issued.patch67
-rw-r--r--series.conf1
2 files changed, 68 insertions, 0 deletions
diff --git a/patches.suse/ceph-skip-updating-wanted-caps-if-caps-are-already-issued.patch b/patches.suse/ceph-skip-updating-wanted-caps-if-caps-are-already-issued.patch
new file mode 100644
index 0000000000..385211fedf
--- /dev/null
+++ b/patches.suse/ceph-skip-updating-wanted-caps-if-caps-are-already-issued.patch
@@ -0,0 +1,67 @@
+From: "Yan, Zheng" <zyan@redhat.com>
+Date: Thu, 22 Nov 2018 15:26:01 +0800
+Subject: ceph: skip updating 'wanted' caps if caps are already issued
+Git-commit: fdac94fab7995ebc52ff9c5b6247133c67a7564a
+Patch-mainline: v5.0-rc1
+References: bsc#1122215
+
+When reading cached inode that already has Fscr caps, this can avoid
+two cap messages (one updats 'wanted' caps, one clears 'wanted' caps).
+
+Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
+Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
+Acked-by: Luis Henriques <lhenriques@suse.com>
+---
+ fs/ceph/caps.c | 27 +++++++++++++++++----------
+ 1 file changed, 17 insertions(+), 10 deletions(-)
+
+--- a/fs/ceph/caps.c
++++ b/fs/ceph/caps.c
+@@ -1970,8 +1970,7 @@ retry_locked:
+ goto ack;
+
+ /* things we might delay */
+- if ((cap->issued & ~retain) == 0 &&
+- cap->mds_wanted == want)
++ if ((cap->issued & ~retain) == 0)
+ continue; /* nope, all good */
+
+ if (no_delay)
+@@ -3047,7 +3046,8 @@ static void handle_cap_grant(struct inod
+ int used, wanted, dirty;
+ u64 size = le64_to_cpu(grant->size);
+ u64 max_size = le64_to_cpu(grant->max_size);
+- int check_caps = 0;
++ unsigned char check_caps = 0;
++ bool was_stale = cap->cap_gen < session->s_cap_gen;
+ bool wake = false;
+ bool writeback = false;
+ bool queue_trunc = false;
+@@ -3199,13 +3199,20 @@ static void handle_cap_grant(struct inod
+ ceph_cap_string(wanted),
+ ceph_cap_string(used),
+ ceph_cap_string(dirty));
+- if (wanted != le32_to_cpu(grant->wanted)) {
+- dout("mds wanted %s -> %s\n",
+- ceph_cap_string(le32_to_cpu(grant->wanted)),
+- ceph_cap_string(wanted));
+- /* imported cap may not have correct mds_wanted */
+- if (le32_to_cpu(grant->op) == CEPH_CAP_OP_IMPORT)
+- check_caps = 1;
++
++ if ((was_stale || le32_to_cpu(grant->op) == CEPH_CAP_OP_IMPORT) &&
++ (wanted & ~(cap->mds_wanted | newcaps))) {
++ /*
++ * If mds is importing cap, prior cap messages that update
++ * 'wanted' may get dropped by mds (migrate seq mismatch).
++ *
++ * We don't send cap message to update 'wanted' if what we
++ * want are already issued. If mds revokes caps, cap message
++ * that releases caps also tells mds what we want. But if
++ * caps got revoked by mds forcedly (session stale). We may
++ * haven't told mds what we want.
++ */
++ check_caps = 1;
+ }
+
+ /* revocation, grant, or no-op? */
diff --git a/series.conf b/series.conf
index df016cc3d9..0bd0d979e3 100644
--- a/series.conf
+++ b/series.conf
@@ -42500,6 +42500,7 @@
patches.suse/libceph-switch-more-to-bool-in-ceph_tcp_sendmsg.patch
patches.fixes/ceph-don-t-update-importing-cap-s-mseq-when-handing-cap-export.patch
patches.suse/ceph-don-t-request-excl-caps-when-mount-is-readonly.patch
+ patches.suse/ceph-skip-updating-wanted-caps-if-caps-are-already-issued.patch
patches.fixes/xfs-xfs_buf-drop-useless-LIST_HEAD.patch
patches.drivers/thermal-bcm2835-enable-hwmon-explicitly.patch
patches.fixes/0001-fbdev-fbmem-behave-better-with-small-rotated-display.patch