mirror of
https://github.com/ceph/ceph
synced 2025-02-22 10:37:15 +00:00
kclient: fix queue_cap_snap refs, calls in handle_snap
Call on correct ci. Skip past dropping inodes without dropping our spinlock. Hold ref on prior inode until we traverse to the next one. (We can't iput while holding our spinlock.)
This commit is contained in:
parent
0fffbfec82
commit
21cb069eab
@ -560,20 +560,24 @@ more:
|
||||
*/
|
||||
if (!deletion) {
|
||||
struct ceph_inode_info *ci;
|
||||
struct inode *lastinode = NULL;
|
||||
|
||||
spin_lock(&realm->inodes_with_caps_lock);
|
||||
list_for_each_entry(ci, &realm->inodes_with_caps,
|
||||
i_snap_realm_item) {
|
||||
struct inode *inode = igrab(&ci->vfs_inode);
|
||||
if (!inode)
|
||||
continue;
|
||||
spin_unlock(&realm->inodes_with_caps_lock);
|
||||
if (inode) {
|
||||
ceph_queue_cap_snap(ci,
|
||||
realm->cached_context);
|
||||
iput(inode);
|
||||
}
|
||||
if (lastinode)
|
||||
iput(lastinode);
|
||||
lastinode = inode;
|
||||
ceph_queue_cap_snap(ci, realm->cached_context);
|
||||
spin_lock(&realm->inodes_with_caps_lock);
|
||||
}
|
||||
spin_unlock(&realm->inodes_with_caps_lock);
|
||||
if (lastinode)
|
||||
iput(lastinode);
|
||||
dout("update_snap_trace cap_snaps queued\n");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user