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:10 +0000
commitb8b605ef138bb13ce7c9b9800a2e8029007176a5 (patch)
tree040caac27d06968f920046ad18733b609f287a21
parent9290adf2a83ec91a61b3e4f20848fb36aaddacc1 (diff)
ceph: don't encode inode pathes into reconnect message
(bsc#1122215).
-rw-r--r--patches.suse/ceph-don-t-encode-inode-pathes-into-reconnect-message.patch177
-rw-r--r--series.conf1
2 files changed, 178 insertions, 0 deletions
diff --git a/patches.suse/ceph-don-t-encode-inode-pathes-into-reconnect-message.patch b/patches.suse/ceph-don-t-encode-inode-pathes-into-reconnect-message.patch
new file mode 100644
index 0000000000..b6976cfc71
--- /dev/null
+++ b/patches.suse/ceph-don-t-encode-inode-pathes-into-reconnect-message.patch
@@ -0,0 +1,177 @@
+From: "Yan, Zheng" <zyan@redhat.com>
+Date: Thu, 13 Dec 2018 16:34:11 +0800
+Subject: ceph: don't encode inode pathes into reconnect message
+Git-commit: 5ccedf1ccd710ba32f36986b49eeb764e53e7ef1
+Patch-mainline: v5.0-rc1
+References: bsc#1122215
+
+mds hasn't used inode pathes since introducing inode backtrace.
+
+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/mds_client.c | 96 ++++++++++++++++++++++++++-------------------------
+ 1 file changed, 50 insertions(+), 46 deletions(-)
+
+--- a/fs/ceph/mds_client.c
++++ b/fs/ceph/mds_client.c
+@@ -2958,11 +2958,8 @@ static int encode_caps_cb(struct inode *
+ struct ceph_inode_info *ci = cap->ci;
+ struct ceph_reconnect_state *recon_state = arg;
+ struct ceph_pagelist *pagelist = recon_state->pagelist;
+- char *path;
+- int pathlen, err;
+- u64 pathbase;
++ int err;
+ u64 snap_follows;
+- struct dentry *dentry;
+
+ dout(" adding %p ino %llx.%llx cap %p %lld %s\n",
+ inode, ceph_vinop(inode), cap, cap->cap_id,
+@@ -2971,19 +2968,6 @@ static int encode_caps_cb(struct inode *
+ if (err)
+ return err;
+
+- dentry = d_find_alias(inode);
+- if (dentry) {
+- path = ceph_mdsc_build_path(dentry, &pathlen, &pathbase, 0);
+- if (IS_ERR(path)) {
+- err = PTR_ERR(path);
+- goto out_dput;
+- }
+- } else {
+- path = NULL;
+- pathlen = 0;
+- pathbase = 0;
+- }
+-
+ spin_lock(&ci->i_ceph_lock);
+ cap->seq = 0; /* reset cap seq */
+ cap->issue_seq = 0; /* and issue_seq */
+@@ -2995,7 +2979,7 @@ static int encode_caps_cb(struct inode *
+ rec.v2.wanted = cpu_to_le32(__ceph_caps_wanted(ci));
+ rec.v2.issued = cpu_to_le32(cap->issued);
+ rec.v2.snaprealm = cpu_to_le64(ci->i_snap_realm->ino);
+- rec.v2.pathbase = cpu_to_le64(pathbase);
++ rec.v2.pathbase = 0;
+ rec.v2.flock_len = (__force __le32)
+ ((ci->i_ceph_flags & CEPH_I_ERROR_FILELOCK) ? 0 : 1);
+ } else {
+@@ -3006,7 +2990,7 @@ static int encode_caps_cb(struct inode *
+ ceph_encode_timespec(&rec.v1.mtime, &inode->i_mtime);
+ ceph_encode_timespec(&rec.v1.atime, &inode->i_atime);
+ rec.v1.snaprealm = cpu_to_le64(ci->i_snap_realm->ino);
+- rec.v1.pathbase = cpu_to_le64(pathbase);
++ rec.v1.pathbase = 0;
+ }
+
+ if (list_empty(&ci->i_cap_snaps)) {
+@@ -3037,7 +3021,7 @@ encode_again:
+ sizeof(struct ceph_filelock), GFP_NOFS);
+ if (!flocks) {
+ err = -ENOMEM;
+- goto out_free;
++ goto out_err;
+ }
+ err = ceph_encode_locks_to_buffer(inode, flocks,
+ num_fcntl_locks,
+@@ -3047,7 +3031,7 @@ encode_again:
+ flocks = NULL;
+ if (err == -ENOSPC)
+ goto encode_again;
+- goto out_free;
++ goto out_err;
+ }
+ } else {
+ kfree(flocks);
+@@ -3067,44 +3051,64 @@ encode_again:
+ sizeof(struct ceph_filelock);
+ rec.v2.flock_len = cpu_to_le32(struct_len);
+
+- struct_len += sizeof(rec.v2);
+- struct_len += sizeof(u32) + pathlen;
++ struct_len += sizeof(u32) + sizeof(rec.v2);
+
+ if (struct_v >= 2)
+ struct_len += sizeof(u64); /* snap_follows */
+
+ total_len += struct_len;
+ err = ceph_pagelist_reserve(pagelist, total_len);
+-
+- if (!err) {
+- if (recon_state->msg_version >= 3) {
+- ceph_pagelist_encode_8(pagelist, struct_v);
+- ceph_pagelist_encode_8(pagelist, 1);
+- ceph_pagelist_encode_32(pagelist, struct_len);
+- }
+- ceph_pagelist_encode_string(pagelist, path, pathlen);
+- ceph_pagelist_append(pagelist, &rec, sizeof(rec.v2));
+- ceph_locks_to_pagelist(flocks, pagelist,
+- num_fcntl_locks,
+- num_flock_locks);
+- if (struct_v >= 2)
+- ceph_pagelist_encode_64(pagelist, snap_follows);
++ if (err) {
++ kfree(flocks);
++ goto out_err;
+ }
++
++ if (recon_state->msg_version >= 3) {
++ ceph_pagelist_encode_8(pagelist, struct_v);
++ ceph_pagelist_encode_8(pagelist, 1);
++ ceph_pagelist_encode_32(pagelist, struct_len);
++ }
++ ceph_pagelist_encode_string(pagelist, NULL, 0);
++ ceph_pagelist_append(pagelist, &rec, sizeof(rec.v2));
++ ceph_locks_to_pagelist(flocks, pagelist,
++ num_fcntl_locks, num_flock_locks);
++ if (struct_v >= 2)
++ ceph_pagelist_encode_64(pagelist, snap_follows);
++
+ kfree(flocks);
+ } else {
+- size_t size = sizeof(u32) + pathlen + sizeof(rec.v1);
+- err = ceph_pagelist_reserve(pagelist, size);
+- if (!err) {
+- ceph_pagelist_encode_string(pagelist, path, pathlen);
+- ceph_pagelist_append(pagelist, &rec, sizeof(rec.v1));
++ u64 pathbase = 0;
++ int pathlen = 0;
++ char *path = NULL;
++ struct dentry *dentry;
++
++ dentry = d_find_alias(inode);
++ if (dentry) {
++ path = ceph_mdsc_build_path(dentry,
++ &pathlen, &pathbase, 0);
++ dput(dentry);
++ if (IS_ERR(path)) {
++ err = PTR_ERR(path);
++ goto out_err;
++ }
++ rec.v1.pathbase = cpu_to_le64(pathbase);
+ }
++
++ err = ceph_pagelist_reserve(pagelist,
++ pathlen + sizeof(u32) + sizeof(rec.v1));
++ if (err) {
++ kfree(path);
++ goto out_err;
++ }
++
++ ceph_pagelist_encode_string(pagelist, path, pathlen);
++ ceph_pagelist_append(pagelist, &rec, sizeof(rec.v1));
++
++ kfree(path);
+ }
+
+ recon_state->nr_caps++;
+-out_free:
+- kfree(path);
+-out_dput:
+- dput(dentry);
++out_err:
+ return err;
+ }
+
diff --git a/series.conf b/series.conf
index 56fedc2190..8a449e850c 100644
--- a/series.conf
+++ b/series.conf
@@ -42502,6 +42502,7 @@
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.suse/ceph-update-wanted-caps-after-resuming-stale-session.patch
+ patches.suse/ceph-don-t-encode-inode-pathes-into-reconnect-message.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