Skip to content

Commit b46ecc1

Browse files
committed
rgw/posix: Account for incomplete uploads during deletes
Signed-off-by: Samarah Uriarte <[email protected]>
1 parent 6282e42 commit b46ecc1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/rgw/driver/posix/rgw_sal_posix.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2755,7 +2755,11 @@ int POSIXBucket::check_empty(const DoutPrefixProvider* dpp, optional_yield y)
27552755
{
27562756
return dir->for_each(dpp, [](const char* name) {
27572757
/* for_each filters out "." and "..", so reaching here is not empty */
2758-
return -ENOTEMPTY;
2758+
std::string_view check_name = name;
2759+
if (!check_name.starts_with(".multipart")) { // incomplete uploads can be deleted
2760+
return -ENOTEMPTY;
2761+
}
2762+
return 0;
27592763
});
27602764
}
27612765

0 commit comments

Comments
 (0)