Skip to content

Commit

Permalink
rgwlc: lock_lambda overwrites ret val
Browse files Browse the repository at this point in the history
`lock_lambda` captures `ret` by reference, it will overwrites
returned value of `bucket_lc_process` when `wait_backoff` is called.

Fixes: c069eb7.

Signed-off-by: Tongliang Deng <[email protected]>
  • Loading branch information
5cs authored and mattbenjamin committed Nov 20, 2023
1 parent 06b3d30 commit c094f1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rgw/rgw_lc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2133,14 +2133,14 @@ int RGWLC::process(int index, int max_lock_secs, LCWorker* worker,

utime_t lock_for_s(max_lock_secs, 0);
const auto& lock_lambda = [&]() {
ret = lock->try_lock(this, lock_for_s, null_yield);
int ret = lock->try_lock(this, lock_for_s, null_yield);
if (ret == 0) {
return true;
}
if (ret == -EBUSY || ret == -EEXIST) {
/* already locked by another lc processor */
return false;
}
}
return false;
};

Expand Down

0 comments on commit c094f1a

Please sign in to comment.