Re: [Question] why not flush device cache at _vg_commit_raw

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2024-01-22 at 18:26 +0300, Ilia Zykov wrote:
> > 
> 
> More over. There is a very old post about fsync() lying.
> https://brad.livejournal.com/2116715.html
> I don’t know, maybe this is also a post-lie) Or now the devices have 
> become more truthful.
> But many devices report that "Write cache" is enabled:
> 
> hdparm -I /dev/sda | grep 'Write cache'
>               * Write cache
> 
> And in many cases fsync() flushes data to write cache only.
> But this can be persistent (ssd, flash) cache. Or as Zdenek has
> wrote,
> "devices 'should' have enough energy held internally to be able to
> flush 
> out all the caches in  in emergency cases".
> 
> However, in some cases, they may lose some data due to power failure
> and 
> large amount of dirty data in the cache, especially ordinary, 
> non-enterprise HDD. IMHO.

SCSI has had SYNCHRONIZE_CACHE and FUA at least since SCSI-2 in the
mid-90s. It's true that some devices lie about the actual behavior,
because bypassing the cache is bad for benchmark results, and many end
users care more about performance than data safety, but that's not LVMs
(or even the kernel's) business. As Su wrote already, the kernel has to
trust the hardware.

Martin






[Index of Archives]     [Gluster Users]     [Kernel Development]     [Linux Clusters]     [Device Mapper]     [Security]     [Bugtraq]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux