Re: [Question] why not flush device cache at _vg_commit_raw
Anthony Iliopoulos <[email protected]> Wed, 24 Jan 2024 14:13:17 +0100
| Newsgroups | gmane.linux.lvm.general |
|---|---|
| Message-ID | <ZbEM7Ri0_30DYHh6@technoir> |
On Wed, Jan 24, 2024 at 01:35:49PM +0100, Zdenek Kabelac wrote: > I guess our dev_flush() function is mostly handling all those cases properly > with the use of ioctl(BLKFLSBUF). This ioctl by itself will only flush the page cache and not device caches, but it is indeed followed by a fsync on the blockdev which is basically the only way for userspace to trigger a device cache flush when operating directly on a block device. > The only problem is - it's usage somehow vanished - and even in the past > it's been basically used only for non-direct usage so likely still not > correct. Indeed, the device cache flushing is required for data integrity irrespective of the io mode (unless O_DSYNC/RWF_DSYNC), direct-io only obviates the need for flushing the page cache. Regards, Anthony