1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

Fix open RO->RW promotions.

This commit is contained in:
Alasdair Kergon 2005-11-23 16:07:40 +00:00
parent 56c282920c
commit 349216a6b5
2 changed files with 2 additions and 4 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.01 - Version 2.02.01 -
==================================== ====================================
Fix open RO->RW promotion.
Fix missing vg_revert in lvcreate error path. Fix missing vg_revert in lvcreate error path.
Version 2.02.00 - 10th November 2005 Version 2.02.00 - 10th November 2005

View File

@ -418,7 +418,6 @@ int dev_open_flags(struct device *dev, int flags, int direct, int quiet)
((fstat(dev->fd, &buf) < 0) || (buf.st_rdev != dev->dev))) { ((fstat(dev->fd, &buf) < 0) || (buf.st_rdev != dev->dev))) {
log_error("%s: fstat failed: Has device name changed?", name); log_error("%s: fstat failed: Has device name changed?", name);
dev_close_immediate(dev); dev_close_immediate(dev);
dev->open_count = 0;
return 0; return 0;
} }
@ -509,11 +508,9 @@ static int _dev_close(struct device *dev, int immediate)
if (dev->open_count > 0) if (dev->open_count > 0)
dev->open_count--; dev->open_count--;
if (immediate && dev->open_count) { if (immediate && dev->open_count)
log_debug("%s: Immediate close attempt while still referenced", log_debug("%s: Immediate close attempt while still referenced",
dev_name(dev)); dev_name(dev));
dev->open_count = 0;
}
/* Close unless device is known to belong to a locked VG */ /* Close unless device is known to belong to a locked VG */
if (immediate || if (immediate ||