Merge pull request #9509 from ukernel/wip-16137

client: skip executing async invalidates while umounting

Reviewed-by: John Spray <john.spray@redhat.com>
This commit is contained in:
John Spray 2016-06-09 10:36:02 +01:00
commit a0d081624b
2 changed files with 15 additions and 15 deletions

View File

@ -3500,31 +3500,29 @@ void Client::wake_inode_waiters(MetaSession *s)
class C_Client_CacheInvalidate : public Context {
private:
Client *client;
InodeRef inode;
vinodeno_t ino;
int64_t offset, length;
public:
C_Client_CacheInvalidate(Client *c, Inode *in, int64_t off, int64_t len) :
client(c), inode(in), offset(off), length(len) {
client(c), offset(off), length(len) {
if (client->use_faked_inos())
ino = vinodeno_t(in->faked_ino, CEPH_NOSNAP);
else
ino = in->vino();
}
void finish(int r) {
// _async_invalidate takes the lock when it needs to, call this back from outside of lock.
assert(!client->client_lock.is_locked_by_me());
client->_async_invalidate(inode, offset, length);
client->_async_invalidate(ino, offset, length);
}
};
void Client::_async_invalidate(InodeRef& in, int64_t off, int64_t len)
void Client::_async_invalidate(vinodeno_t ino, int64_t off, int64_t len)
{
ldout(cct, 10) << "_async_invalidate " << off << "~" << len << dendl;
if (use_faked_inos())
ino_invalidate_cb(callback_handle, vinodeno_t(in->faked_ino, CEPH_NOSNAP), off, len);
else
ino_invalidate_cb(callback_handle, in->vino(), off, len);
client_lock.Lock();
in.reset(); // put inode inside client_lock
client_lock.Unlock();
ldout(cct, 10) << "_async_invalidate " << off << "~" << len << " done" << dendl;
if (unmounting)
return;
ldout(cct, 10) << "_async_invalidate " << ino << " " << off << "~" << len << dendl;
ino_invalidate_cb(callback_handle, ino, off, len);
}
void Client::_schedule_invalidate_callback(Inode *in, int64_t off, int64_t len) {
@ -4697,6 +4695,8 @@ public:
void Client::_async_dentry_invalidate(vinodeno_t dirino, vinodeno_t ino, string& name)
{
if (unmounting)
return;
ldout(cct, 10) << "_async_dentry_invalidate '" << name << "' ino " << ino
<< " in dir " << dirino << dendl;
dentry_invalidate_cb(callback_handle, dirino, ino, name);

View File

@ -628,7 +628,7 @@ protected:
void _schedule_invalidate_callback(Inode *in, int64_t off, int64_t len);
void _invalidate_inode_cache(Inode *in);
void _invalidate_inode_cache(Inode *in, int64_t off, int64_t len);
void _async_invalidate(InodeRef& in, int64_t off, int64_t len);
void _async_invalidate(vinodeno_t ino, int64_t off, int64_t len);
bool _release(Inode *in);
/**