This avoid getting wrlocks and setup client_snap_caps on snap inode.
Because there is no further snapflush that triggers releasing these
wrlocks.
Fixes: https://tracker.ceph.com/issues/40361
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
// client flushes and releases caps at the same time. make sure MDCache::cow_inode()
// properly setup CInode::client_need_snapflush
- if ((dirty & ~cap->issued()) && !need_snapflush)
+ if (!need_snapflush && (dirty & ~cap->issued()) &&
+ (m->flags & MClientCaps::FLAG_PENDING_CAPSNAP))
cap->mark_needsnapflush();
}