From: Mer Xuanyi Date: Mon, 24 Apr 2023 03:51:38 +0000 (+0800) Subject: client: use deep-copy when setting permission during make_request X-Git-Tag: v18.1.3~25^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7def1c26e3b0084faf0d503976db3dba34a7de46;p=ceph.git client: use deep-copy when setting permission during make_request We need MetaRequest's perms.gids keeps longer than syscal if mds reboot. When mds reboot we need to rebuild MClientRequest with MetaRequest. Fixes: https://tracker.ceph.com/issues/59514 Signed-off-by: Mer Xuanyi (cherry picked from commit b88f50d1e396dc546a7a760da522ad434325bcd8) --- diff --git a/src/client/MetaRequest.h b/src/client/MetaRequest.h index ea393066082..a1c9f94598b 100644 --- a/src/client/MetaRequest.h +++ b/src/client/MetaRequest.h @@ -163,7 +163,7 @@ public: void set_alternate_name(std::string an) { alternate_name = an; } void set_string2(const char *s) { path2.set_path(std::string_view(s), 0); } void set_caller_perms(const UserPerm& _perms) { - perms.shallow_copy(_perms); + perms = _perms; head.caller_uid = perms.uid(); head.caller_gid = perms.gid(); }