Home Home > GIT Browse > SLE12-SP5-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuis Henriques <lhenriques@suse.com>2019-09-03 10:55:15 +0100
committerLuis Henriques <lhenriques@suse.com>2019-09-05 10:08:48 +0100
commit629b4f4512faf4dd37df9b4034a1f000816974f3 (patch)
tree643ebf6fc0fbeadc46daa8edba6f11694c5f0824
parentb49713399f2c110401705908c8546ee5778df2c2 (diff)
ceph: hold i_ceph_lock when removing caps for freeing inode
(bsc#1148133).
-rw-r--r--patches.suse/ceph-hold-i_ceph_lock-when-removing-caps-for-freeing-inode.patch48
-rw-r--r--series.conf1
2 files changed, 49 insertions, 0 deletions
diff --git a/patches.suse/ceph-hold-i_ceph_lock-when-removing-caps-for-freeing-inode.patch b/patches.suse/ceph-hold-i_ceph_lock-when-removing-caps-for-freeing-inode.patch
new file mode 100644
index 0000000000..30c6488231
--- /dev/null
+++ b/patches.suse/ceph-hold-i_ceph_lock-when-removing-caps-for-freeing-inode.patch
@@ -0,0 +1,48 @@
+From: "Yan, Zheng" <zyan@redhat.com>
+Date: Thu, 23 May 2019 11:01:37 +0800
+Subject: ceph: hold i_ceph_lock when removing caps for freeing inode
+Git-commit: d6e47819721ae2d9d090058ad5570a66f3c42e39
+Patch-mainline: v5.3-rc1
+References: bsc#1148133
+
+ceph_d_revalidate(, LOOKUP_RCU) may call __ceph_caps_issued_mask()
+on a freeing inode.
+
+Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
+Reviewed-by: Jeff Layton <jlayton@redhat.com>
+Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
+Acked-by: Luis Henriques <lhenriques@suse.com>
+[luis: modified ceph_queue_caps_release() instead of __ceph_remove_caps,
+ as in stable 4.14]
+---
+ fs/ceph/caps.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+--- a/fs/ceph/caps.c
++++ b/fs/ceph/caps.c
+@@ -1239,20 +1239,23 @@ static int send_cap_msg(struct cap_msg_a
+ }
+
+ /*
+- * Queue cap releases when an inode is dropped from our cache. Since
+- * inode is about to be destroyed, there is no need for i_ceph_lock.
++ * Queue cap releases when an inode is dropped from our cache.
+ */
+ void ceph_queue_caps_release(struct inode *inode)
+ {
+ struct ceph_inode_info *ci = ceph_inode(inode);
+ struct rb_node *p;
+
++ /* lock i_ceph_lock, because ceph_d_revalidate(..., LOOKUP_RCU)
++ * may call __ceph_caps_issued_mask() on a freeing inode. */
++ spin_lock(&ci->i_ceph_lock);
+ p = rb_first(&ci->i_caps);
+ while (p) {
+ struct ceph_cap *cap = rb_entry(p, struct ceph_cap, ci_node);
+ p = rb_next(p);
+ __ceph_remove_cap(cap, true);
+ }
++ spin_unlock(&ci->i_ceph_lock);
+ }
+
+ /*
diff --git a/series.conf b/series.conf
index 9564b6ef9a..01805f69ff 100644
--- a/series.conf
+++ b/series.conf
@@ -23913,6 +23913,7 @@
patches.suse/ceph-clean-up-ceph-dir-pin-vxattr-name-sizeof.patch
patches.suse/ceph-fix-ceph-dir-rctime-vxattr-value.patch
patches.suse/ceph-fix-improper-use-of-smp_mb__before_atomic.patch
+ patches.suse/ceph-hold-i_ceph_lock-when-removing-caps-for-freeing-inode.patch
patches.suse/ceph-don-t-blindly-unregister-session-that-is-in-opening-state.patch
patches.suse/ceph-remove-request-from-waiting-list-before-unregister.patch
patches.suse/cifs-Use-kmemdup-in-SMB2_ioctl_init-.patch