Skip to content

Commit 2307863

Browse files
ukernelidryomov
authored andcommitted
ceph: fix queuing inode to mdsdir's snaprealm
During MDS failovers, MClientSnap message may cause kclient to move some inodes from root directory's snaprealm to mdsdir's snaprealm and queue snapshots for these inodes. For a FS has never created any snapshot, both root directory's snaprealm and mdsdir's snaprealm share the same snapshot contexts (both are ceph_empty_snapc). This confuses ceph_put_wrbuffer_cap_refs(), make it unable to distinguish snapshot buffers from head buffers. The fix is do not use ceph_empty_snapc as snaprealm's cached context. Signed-off-by: Yan, Zheng <zyan@redhat.com>
1 parent 6893162 commit 2307863

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

fs/ceph/snap.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,6 @@ static int build_snap_context(struct ceph_snap_realm *realm)
338338
return 0;
339339
}
340340

341-
if (num == 0 && realm->seq == ceph_empty_snapc->seq) {
342-
ceph_get_snap_context(ceph_empty_snapc);
343-
snapc = ceph_empty_snapc;
344-
goto done;
345-
}
346-
347341
/* alloc new snap context */
348342
err = -ENOMEM;
349343
if (num > (SIZE_MAX - sizeof(*snapc)) / sizeof(u64))
@@ -381,7 +375,6 @@ static int build_snap_context(struct ceph_snap_realm *realm)
381375
realm->ino, realm, snapc, snapc->seq,
382376
(unsigned int) snapc->num_snaps);
383377

384-
done:
385378
ceph_put_snap_context(realm->cached_context);
386379
realm->cached_context = snapc;
387380
return 0;

0 commit comments

Comments
 (0)