]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mds: fix check of underwater dentries 21187/head
authorYan, Zheng <zyan@redhat.com>
Sat, 17 Feb 2018 01:37:48 +0000 (09:37 +0800)
committerYan, Zheng <zyan@redhat.com>
Tue, 5 Jun 2018 00:28:47 +0000 (08:28 +0800)
commitcb95da52820a453d6874e6d15db4993962f0e17b
tree7a57cb99ae06b45094066e5b69779aa0d2bcaff6
parent5801ba92faa8fbb07016e7a99ebed002e13adaca
mds: fix check of underwater dentries

Underwater dentry is dentry that is dirty in our cache from journal
replay, but had already been flushed to disk before the mds failed.
To decide if an dentry is underwater, original code compares dirty
dentry's version to on-disk dirfrag's version. This method is racy
because CDir::log_mark_dirty() can increase dirfrag's version without
adding log event. After mds failover, version of dirfrag from journal
replay can be less than on-disk dirfrag's version. So newly dirtied
dentry can be equal to or less than the on-disk dirfrag's version.

The race can cause incorrect fragstat/rstat

Fixes: http://tracker.ceph.com/issues/23032
Signed-off-by: Yan, Zheng <zyan@redhat.com>
(cherry picked from commit 9d271696b7735ab5b7384cdd386d6ac3eaafe437)

Conflicts:
src/mds/CDir.cc - conditional being replaced by "if (!dn)" is different
                          in luminous
src/mds/CDir.cc
src/mds/CDir.h