also drop bdev_flock_retry and bdev_flock_retry_interval from
legacy_config_opts.h, as `KernelDevice::_lock()` is not in the critical
path, there is no need to access these settings via member variables --
get_val<> would just suffice.
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit
8fb80db9ff32a85fcdf91e38075c42165805e37f)
Conflicts:
src/blk/kernel/KernelDevice.cc
- file does not exist in nautilus; changes applied without conflicts to
src/os/bluestore/KernelDevice.cc
OPTION(bdev_nvme_retry_count, OPT_INT) // -1 means by default which is 4
OPTION(bdev_enable_discard, OPT_BOOL)
OPTION(bdev_async_discard, OPT_BOOL)
-OPTION(bdev_flock_retry_interval, OPT_FLOAT)
-OPTION(bdev_flock_retry, OPT_INT)
OPTION(objectstore_blackhole, OPT_BOOL)
.set_default(0.1)
.set_description("interval to retry the flock"),
- Option("bdev_flock_retry", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("bdev_flock_retry", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(3)
.set_description("times to retry the flock"),
{
dout(10) << __func__ << " " << fd_directs[WRITE_LIFE_NOT_SET] << dendl;
double retry_interval = cct->_conf.get_val<double>("bdev_flock_retry_interval");
-
+ uint64_t max_retry = cct->_conf.get_val<uint64_t>("bdev_flock_retry");
// When the block changes, systemd-udevd will open the block,
// read some information and close it. Then a failure occurs here.
// So we need to try again here.
- for (int i = 0; i < cct->_conf->bdev_flock_retry + 1; i++) {
+ for (uint64_t i = 0; i < max_retry + 1; i++) {
int r = ::flock(fd_directs[WRITE_LIFE_NOT_SET], LOCK_EX | LOCK_NB);
if (r < 0 && errno == EAGAIN) {
dout(1) << __func__ << " flock busy on " << path << dendl;