]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
Client: check dir is still complete after dropping locks in _readdir_cache_cb 5260/head
authorGreg Farnum <gfarnum@redhat.com>
Thu, 16 Jul 2015 11:45:05 +0000 (04:45 -0700)
committerGreg Farnum <gfarnum@redhat.com>
Thu, 16 Jul 2015 16:24:56 +0000 (09:24 -0700)
commit62dd63761701a7e0f7ce39f4071dcabc19bb1cf4
tree99512bcc3903701ddb99ec144643d45524ee529f
parent66dcbaed3c3c8e4b5367ba1cd2859271e692e7e0
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>
src/client/Client.cc