mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-17 06:04:23 +03:00
device: Fix an unpaired device close.
dev_open_flags contains an unpaired dev_close_immediate so increment open_count before calling it.
This commit is contained in:
parent
b96862ee11
commit
e932c5da50
@ -491,11 +491,12 @@ int dev_open_flags(struct device *dev, int flags, int direct, int quiet)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dev->open_count && !need_excl) {
|
if (dev->open_count && !need_excl)
|
||||||
log_debug_devs("%s: Already opened read-only. Upgrading "
|
log_debug_devs("%s: Already opened read-only. Upgrading "
|
||||||
"to read-write.", dev_name(dev));
|
"to read-write.", dev_name(dev));
|
||||||
|
|
||||||
|
/* dev_close_immediate will decrement this */
|
||||||
dev->open_count++;
|
dev->open_count++;
|
||||||
}
|
|
||||||
|
|
||||||
dev_close_immediate(dev);
|
dev_close_immediate(dev);
|
||||||
// FIXME: dev with DEV_ALLOCED is released
|
// FIXME: dev with DEV_ALLOCED is released
|
||||||
|
Loading…
x
Reference in New Issue
Block a user