]> sourceware.org Git - lvm2.git/commitdiff
o Perform a BLKFLSBUF ioctl whenever a block device is closed.
authorJoe Thornber <thornber@redhat.com>
Mon, 8 Apr 2002 18:59:50 +0000 (18:59 +0000)
committerJoe Thornber <thornber@redhat.com>
Mon, 8 Apr 2002 18:59:50 +0000 (18:59 +0000)
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.

lib/device/dev-io.c

index 6f49165ff30375af2f6173c9388f215e07b59fc8..30447d3d694582427b7ba3891fad31e86b54b6d8 100644 (file)
@@ -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));
 
This page took 0.041191 seconds and 5 git commands to generate.