Re: [PATCH] issue storage device flush via sync_blockdev() (was Re: Linux 2.6.29)

Jeff Garzik
2009-03-25T23:12:58Z

Alan Cox wrote:
>> This is a simple step that would cover a lot of cases... sync(2)
>> calls sync_blockdev(), and many filesystems do as well via the generic
>> filesystem helper file_fsync (fs/sync.c).
>
> file_fsync probably needs to pass down more information so you can make
> this a mount option. It's going to depend on the application whether the
> flush is good bad or indifferent.

file_fsync is only used by ancient legacy filesystems, who specifically
don't want to bother with anything more complicated: HFS, HFS+, ADFS,
AFFS, FAT, bfs, UFS, NTFS, qnx4.

IOW they _already_ consciously implement fsync(2) as "flush ENTIRE
blockdev".

I think it is worth it to simply wait and see if mount options are even
wanted.

Jeff