|
|
@@ -1290,6 +1290,15 @@ static int remove_session_caps_cb(struct inode *inode, struct ceph_cap *cap,
|
|
|
list_add(&ci->i_prealloc_cap_flush->i_list, &to_remove);
|
|
|
ci->i_prealloc_cap_flush = NULL;
|
|
|
}
|
|
|
+
|
|
|
+ if (drop &&
|
|
|
+ ci->i_wrbuffer_ref_head == 0 &&
|
|
|
+ ci->i_wr_ref == 0 &&
|
|
|
+ ci->i_dirty_caps == 0 &&
|
|
|
+ ci->i_flushing_caps == 0) {
|
|
|
+ ceph_put_snap_context(ci->i_head_snapc);
|
|
|
+ ci->i_head_snapc = NULL;
|
|
|
+ }
|
|
|
}
|
|
|
spin_unlock(&ci->i_ceph_lock);
|
|
|
while (!list_empty(&to_remove)) {
|