mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
Merge PR #22512 into master
* refs/pull/22512/head: client: fix bug #24491 _ll_drop_pins may access invalid iterator Reviewed-by: Patrick Donnelly <pdonnell@redhat.com> Reviewed-by: Zheng Yan <zyan@redhat.com>
This commit is contained in:
commit
8db4bedabd
@ -10472,6 +10472,7 @@ int Client::_ll_put(Inode *in, int num)
|
||||
void Client::_ll_drop_pins()
|
||||
{
|
||||
ldout(cct, 10) << __func__ << dendl;
|
||||
std::set<InodeRef> to_be_put; //this set will be deconstructed item by item when exit
|
||||
ceph::unordered_map<vinodeno_t, Inode*>::iterator next;
|
||||
for (ceph::unordered_map<vinodeno_t, Inode*>::iterator it = inode_map.begin();
|
||||
it != inode_map.end();
|
||||
@ -10479,8 +10480,10 @@ void Client::_ll_drop_pins()
|
||||
Inode *in = it->second;
|
||||
next = it;
|
||||
++next;
|
||||
if (in->ll_ref)
|
||||
if (in->ll_ref){
|
||||
to_be_put.insert(in);
|
||||
_ll_put(in, in->ll_ref);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user