Skip to content

Commit a594874

Browse files
committed
Merge tag 'ceph-for-6.4-rc3' of https://github.com/ceph/ceph-client
Pull ceph fixes from Ilya Dryomov: "A workaround for a just discovered bug in MClientSnap encoding which goes back to 2017 (marked for stable) and a fixup to quieten a static checker" * tag 'ceph-for-6.4-rc3' of https://github.com/ceph/ceph-client: ceph: force updating the msg pointer in non-split case ceph: silence smatch warning in reconnect_caps_cb()
2 parents d3f7043 + 4cafd04 commit a594874

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

fs/ceph/mds_client.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3942,7 +3942,7 @@ static int reconnect_caps_cb(struct inode *inode, int mds, void *arg)
39423942
struct dentry *dentry;
39433943
struct ceph_cap *cap;
39443944
char *path;
3945-
int pathlen = 0, err = 0;
3945+
int pathlen = 0, err;
39463946
u64 pathbase;
39473947
u64 snap_follows;
39483948

@@ -3965,6 +3965,7 @@ static int reconnect_caps_cb(struct inode *inode, int mds, void *arg)
39653965
cap = __get_cap_for_mds(ci, mds);
39663966
if (!cap) {
39673967
spin_unlock(&ci->i_ceph_lock);
3968+
err = 0;
39683969
goto out_err;
39693970
}
39703971
dout(" adding %p ino %llx.%llx cap %p %lld %s\n",

fs/ceph/snap.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,19 @@ void ceph_handle_snap(struct ceph_mds_client *mdsc,
11111111
continue;
11121112
adjust_snap_realm_parent(mdsc, child, realm->ino);
11131113
}
1114+
} else {
1115+
/*
1116+
* In the non-split case both 'num_split_inos' and
1117+
* 'num_split_realms' should be 0, making this a no-op.
1118+
* However the MDS happens to populate 'split_realms' list
1119+
* in one of the UPDATE op cases by mistake.
1120+
*
1121+
* Skip both lists just in case to ensure that 'p' is
1122+
* positioned at the start of realm info, as expected by
1123+
* ceph_update_snap_trace().
1124+
*/
1125+
p += sizeof(u64) * num_split_inos;
1126+
p += sizeof(u64) * num_split_realms;
11141127
}
11151128

11161129
/*

0 commit comments

Comments
 (0)