mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
devices: fix reopen for unopened device
If there's a request to reopen rw a device that's not open, then just call the normal open function.
This commit is contained in:
parent
8952dcbff0
commit
890c7ef451
@ -1460,7 +1460,8 @@ int label_scan_reopen_rw(struct device *dev)
|
|||||||
dev_name(dev), dev->bcache_fd, dev->bcache_di);
|
dev_name(dev), dev->bcache_fd, dev->bcache_di);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
goto do_open;
|
dev->flags |= DEV_BCACHE_WRITE;
|
||||||
|
return _scan_dev_open(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((dev->flags & DEV_BCACHE_WRITE))
|
if ((dev->flags & DEV_BCACHE_WRITE))
|
||||||
@ -1477,7 +1478,6 @@ int label_scan_reopen_rw(struct device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
do_open:
|
|
||||||
flags |= O_DIRECT;
|
flags |= O_DIRECT;
|
||||||
flags |= O_NOATIME;
|
flags |= O_NOATIME;
|
||||||
flags |= O_RDWR;
|
flags |= O_RDWR;
|
||||||
|
Loading…
Reference in New Issue
Block a user