From a6611a55cc47736c75a3d6534127a980016ff0ba Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Mon, 17 Jan 2022 14:45:28 -0500 Subject: [PATCH] rgw/swift: don't crash on nonexistent bucket in BulkUpload Signed-off-by: Casey Bodley --- src/rgw/rgw_op.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 89f579228f63e..bc7429335f79b 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -7389,9 +7389,10 @@ int RGWBulkUploadOp::handle_file(const std::string_view path, ACLOwner bowner; op_ret = store->get_bucket(this, s->user.get(), rgw_bucket(rgw_bucket_key(s->user->get_tenant(), bucket_name)), &bucket, y); - if (op_ret == -ENOENT) { - ldpp_dout(this, 20) << "non existent directory=" << bucket_name << dendl; - } else if (op_ret < 0) { + if (op_ret < 0) { + if (op_ret == -ENOENT) { + ldpp_dout(this, 20) << "non existent directory=" << bucket_name << dendl; + } return op_ret; } -- 2.39.5