aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/snap.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ceph/snap.c')
-rw-r--r--fs/ceph/snap.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c
index 89aa37fa0f84..b26e12cd8ec3 100644
--- a/fs/ceph/snap.c
+++ b/fs/ceph/snap.c
@@ -572,7 +572,12 @@ void ceph_queue_cap_snap(struct ceph_inode_info *ci)
572 old_snapc = NULL; 572 old_snapc = NULL;
573 573
574update_snapc: 574update_snapc:
575 if (ci->i_head_snapc) { 575 if (ci->i_wrbuffer_ref_head == 0 &&
576 ci->i_wr_ref == 0 &&
577 ci->i_dirty_caps == 0 &&
578 ci->i_flushing_caps == 0) {
579 ci->i_head_snapc = NULL;
580 } else {
576 ci->i_head_snapc = ceph_get_snap_context(new_snapc); 581 ci->i_head_snapc = ceph_get_snap_context(new_snapc);
577 dout(" new snapc is %p\n", new_snapc); 582 dout(" new snapc is %p\n", new_snapc);
578 } 583 }