diff options
author | Xiubo Li <xiubli@redhat.com> | 2021-02-02 14:54:53 +0800 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2021-02-16 12:09:52 +0100 |
commit | 558b4510f622a3d96cf9d95050a04e7793d343c7 (patch) | |
tree | 07048dbf2929942fcb83a7994af1b5d7134d242a /fs/ceph/snap.c | |
parent | d7ef2e59e3b908285fbbb815c4547bdba4299890 (diff) | |
download | lwn-558b4510f622a3d96cf9d95050a04e7793d343c7.tar.gz lwn-558b4510f622a3d96cf9d95050a04e7793d343c7.zip |
ceph: defer flushing the capsnap if the Fb is used
If the Fb cap is used it means the current inode is flushing the
dirty data to OSD, just defer flushing the capsnap.
URL: https://tracker.ceph.com/issues/48640
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/snap.c')
-rw-r--r-- | fs/ceph/snap.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c index b611f829cb61..0728b01d4d43 100644 --- a/fs/ceph/snap.c +++ b/fs/ceph/snap.c @@ -623,6 +623,16 @@ int __ceph_finish_cap_snap(struct ceph_inode_info *ci, return 0; } + /* Fb cap still in use, delay it */ + if (ci->i_wb_ref) { + dout("finish_cap_snap %p cap_snap %p snapc %p %llu %s s=%llu " + "used WRBUFFER, delaying\n", inode, capsnap, + capsnap->context, capsnap->context->seq, + ceph_cap_string(capsnap->dirty), capsnap->size); + capsnap->writing = 1; + return 0; + } + ci->i_ceph_flags |= CEPH_I_FLUSH_SNAPS; dout("finish_cap_snap %p cap_snap %p snapc %p %llu %s s=%llu\n", inode, capsnap, capsnap->context, |