Open the device read-only in vitastor-nbd unmap #162
@@ -505,7 +505,8 @@ help:
|
||||
}
|
||||
// Run unmap
|
||||
snprintf(path, sizeof(path), "/dev/nbd%d", dev_num);
|
||||
int r, nbd = open(path, O_RDWR);
|
||||
// Not O_RDWR: closing a writable descriptor makes udev rescan the device
|
||||
int r, nbd = open(path, O_RDONLY);
|
||||
if (nbd < 0)
|
||||
{
|
||||
perror("open");
|
||||
|
||||
Reference in New Issue
Block a user