]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
Client: check dir is still complete after dropping locks in _readdir_cache_cb 5381/head
authorGreg Farnum <gfarnum@redhat.com>
Thu, 16 Jul 2015 11:45:05 +0000 (04:45 -0700)
committerLoic Dachary <ldachary@redhat.com>
Tue, 28 Jul 2015 15:14:38 +0000 (17:14 +0200)
commit256620e37fd94ee4b3af338ea6955be55529d0d6
tree738cc0d49d974364964ea273e224e5cfe029eaa1
parent45beb86423c3bd74dbafd36c6822e71ad9680e17
Client: check dir is still complete after dropping locks in _readdir_cache_cb

We drop the lock when invoking the callback, which means the directory
we're looking at might get dentries trimmed out of memory. Make sure that
hasn't happened after we get the lock back. If it *has* happened, fall back
to requesting the directory contents from the MDS. Update the dirp location
pointers after each entry to facilitate this.
Because this requires we update the dirp->at_cache_name value on every loop,
we rework the updating scheme a bit: to dereference the dn->name before
unlocking, so we know it's filled in; and since we update it on every loop
we don't need to refer to the previous dentry explicitly like we did before.

This should also handle racing file deletes: we get back a trace on
the removed dentry and that will clear the COMPLETE|ORDERED flags.

Fixes #12297

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
(cherry picked from commit 62dd63761701a7e0f7ce39f4071dcabc19bb1cf4)
src/client/Client.cc