mirror of
https://github.com/ceph/ceph
synced 2025-02-22 18:47:18 +00:00
rbd-nbd: only try to load nbd module once when open nbd device, during do_map operation.
Signed-off-by: Pan Liu <liupan1111@gmail.com>
This commit is contained in:
parent
58a273d194
commit
37aa18858b
@ -562,10 +562,12 @@ static int do_map(int argc, const char *argv[])
|
||||
|
||||
if (devpath.empty()) {
|
||||
char dev[64];
|
||||
bool try_load_module = true;
|
||||
while (true) {
|
||||
snprintf(dev, sizeof(dev), "/dev/nbd%d", index);
|
||||
|
||||
nbd = open_device(dev, true);
|
||||
nbd = open_device(dev, try_load_module);
|
||||
try_load_module = false;
|
||||
if (nbd < 0) {
|
||||
r = nbd;
|
||||
cerr << "rbd-nbd: failed to find unused device" << std::endl;
|
||||
|
Loading…
Reference in New Issue
Block a user