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: v17.2.7~297^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d5ff8cf7f77db178cb3b38334da9526b53b90951;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 4dc8a53b872..7a798eaeaee 100644 --- a/src/client/MetaRequest.h +++ b/src/client/MetaRequest.h @@ -161,7 +161,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(); }