Skip to content

ceph: trigger to flush the buffer when making snapshot

Xiubo Li requested to merge xiubli/centos-stream-9:Jira#RHEL-9417 into main

Merge Request Required Information

Summary of Changes

JIRA: https://issues.redhat.com/browse/RHEL-9417

commit 2d12ad950b0c2a89d82f5d258309ad23aa70fc38 Author: Xiubo Li xiubli@redhat.com Date: Thu May 11 13:19:45 2023 +0800

ceph: trigger to flush the buffer when making snapshot

The 'i_wr_ref' is used to track the 'Fb' caps, while whenever the 'Fb'
caps is took the kclient will always take the 'Fw' caps at the same
time. That means it will always be a false check in __ceph_finish_cap_snap().

When writing to buffer the kclient will take both 'Fb|Fw' caps and then
write the contents to the buffer pages by increasing the 'i_wrbuffer_ref'
and then just release both 'Fb|Fw'. This is different with the user
space libcephfs, which will keep the 'Fb' being took and use 'i_wr_ref'
instead of 'i_wrbuffer_ref' to track this until the buffer is flushed
to Rados.

We need to defer flushing the capsnap until the corresponding buffer
pages are all flushed to Rados, and at the same time just trigger to
flush the buffer pages immediately.

Link: https://tracker.ceph.com/issues/48640
Link: https://tracker.ceph.com/issues/59343
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>

Signed-off-by: Xiubo Li xiubli@redhat.com

Approved Development Ticket

All submissions to CentOS Stream must reference an approved ticket in Red Hat Jira. Please follow the CentOS Stream contribution documentation for how to file this ticket and have it approved.

Edited by Xiubo Li

Merge request reports