Skip to content

Commit e77dc3e

Browse files
committed
ceph: only queue capsnap if caps are dirty
We used to go into this branch if i_wrbuffer_ref_head was non-zero. This was an ancient check from before we were careful about dealing with all kinds of caps (and not just dirty pages). It is cleaner to only queue a capsnap if there is an actual dirty cap. If we are racing with... something...we will end up here with ci->i_wrbuffer_refs but no dirty caps. Reviewed-by: Yehuda Sadeh <yehuda@hq.newdream.net> Signed-off-by: Sage Weil <sage@newdream.net>
1 parent af0ed56 commit e77dc3e

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎fs/ceph/snap.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -465,9 +465,8 @@ void ceph_queue_cap_snap(struct ceph_inode_info *ci)
465465
cap_snap. lucky us. */
466466
dout("queue_cap_snap %p already pending\n", inode);
467467
kfree(capsnap);
468-
} else if (ci->i_wrbuffer_ref_head ||
469-
(dirty & (CEPH_CAP_AUTH_EXCL|CEPH_CAP_XATTR_EXCL|
470-
CEPH_CAP_FILE_EXCL|CEPH_CAP_FILE_WR))) {
468+
} else if (dirty & (CEPH_CAP_AUTH_EXCL|CEPH_CAP_XATTR_EXCL|
469+
CEPH_CAP_FILE_EXCL|CEPH_CAP_FILE_WR)) {
471470
struct ceph_snap_context *snapc = ci->i_head_snapc;
472471

473472
/*
@@ -480,7 +479,6 @@ void ceph_queue_cap_snap(struct ceph_inode_info *ci)
480479
dout("queue_cap_snap %p cap_snap %p queuing under %p %s\n",
481480
inode, capsnap, snapc, ceph_cap_string(dirty));
482481
ihold(inode);
483-
BUG_ON(dirty == 0);
484482

485483
atomic_set(&capsnap->nref, 1);
486484
capsnap->ci = ci;

0 commit comments

Comments
 (0)