mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
o Perform a BLKFLSBUF ioctl whenever a block device is closed.
Patrick, can you see if this fixes your cluster syncing problem please ? If so I'll make it so it only syncs if you have actually written to the device.
This commit is contained in:
parent
2fab033e9b
commit
f31c47ade8
@ -96,6 +96,12 @@ int dev_open(struct device *dev, int flags)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void _flush(int fd)
|
||||
{
|
||||
if (ioctl(fd, BLKFLSBUF, 0))
|
||||
log_error("couldn't flush device.");
|
||||
}
|
||||
|
||||
int dev_close(struct device *dev)
|
||||
{
|
||||
if (dev->fd < 0) {
|
||||
@ -104,6 +110,8 @@ int dev_close(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
_flush(dev->fd);
|
||||
|
||||
if (close(dev->fd))
|
||||
log_sys_error("close", dev_name(dev));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user