From 95ceb5e107a506b0577d247a75406aa2c4daa3dc Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Mon, 13 Dec 2021 12:50:40 +0800 Subject: [PATCH] client: always queue the dirty Inode in delayed_list If the check_caps() won't be trigger for some Inode, the dirty caps could be kept in the client side for a long time, in some cases it could make the client hold a lot of caps, which could exceed the mds's limitation. Signed-off-by: Xiubo Li (cherry picked from commit d4c175cd5e0f97ca75ee9e62592ac41e3da9c805) Conflicts: src/client/Client.cc --- src/client/Client.cc | 1 + src/client/Inode.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/src/client/Client.cc b/src/client/Client.cc index 1944e6081a0..d5993d84159 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -3980,6 +3980,7 @@ void Client::check_caps(Inode *in, unsigned flags) flush_tid = 0; } + in->delay_cap_item.remove_myself(); send_cap(in, session, &cap, msg_flags, cap_used, wanted, retain, flushing, flush_tid); } diff --git a/src/client/Inode.cc b/src/client/Inode.cc index da68c24c439..2260811f482 100644 --- a/src/client/Inode.cc +++ b/src/client/Inode.cc @@ -778,6 +778,7 @@ void Inode::mark_caps_dirty(int caps) iget(); dirty_caps |= caps; client->get_dirty_list().push_back(&dirty_cap_item); + client->cap_delay_requeue(this); } /** -- 2.47.3