1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Try alternative syncs if BLKFLSBUF fails.

This commit is contained in:
Alasdair Kergon 2003-04-28 16:20:39 +00:00
parent 662b119be6
commit fe451a01e8

View File

@ -72,7 +72,13 @@ int dev_get_sectsize(struct device *dev, uint32_t *size)
static void _flush(int fd)
{
ioctl(fd, BLKFLSBUF, 0);
if (ioctl(fd, BLKFLSBUF, 0) >= 0)
return;
if (fsync(fd) >= 0)
return;
sync();
}
int dev_open(struct device *dev, int flags)