From: zhipeng li Date: Sat, 13 Nov 2021 03:58:39 +0000 (-0500) Subject: rgw: when radosgw-admin stating user, add user exists judging X-Git-Tag: v17.1.0~279^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c1c4da3804bd37e43830d062d3feb193adb2ec6f;p=ceph.git rgw: when radosgw-admin stating user, add user exists judging Fixes:https://tracker.ceph.com/issues/53172 Signed-off-by: zhipeng li --- diff --git a/src/rgw/services/svc_user_rados.cc b/src/rgw/services/svc_user_rados.cc index bb8e8aaf886..b2f8f9665e0 100644 --- a/src/rgw/services/svc_user_rados.cc +++ b/src/rgw/services/svc_user_rados.cc @@ -910,9 +910,17 @@ int RGWSI_User_RADOS::read_stats(const DoutPrefixProvider *dpp, { string user_str = user.to_str(); + RGWUserInfo info; + real_time mtime; + int ret = read_user_info(ctx, user, &info, nullptr, &mtime, nullptr, nullptr, null_yield, dpp); + if (ret < 0) + { + return ret; + } + cls_user_header header; int r = cls_user_get_header(dpp, rgw_user(user_str), &header, y); - if (r < 0) + if (r < 0 && r != -ENOENT) return r; const cls_user_stats& hs = header.stats;