[linux-lvm] fsync() and LVM
Les Mikesell
lesmikesell at gmail.com
Mon Mar 16 18:50:27 UTC 2009
Stuart D. Gathman wrote:
>
>> No, it's more than that. PostgreSQL gurus say LVM doesn't honor fsync(),
>
> That is clearly wrong - since fsync() isn't LVM's responsibility.
> I think they mean that fsync() can't garrantee that any writes are
> actually on the platter.
>
>> that data doesn't even get to the controller, and it doesn't matter
>> if the disks have write caches enabled or not. Or if they have battery backed
>> caches. Please read the thread I linked. If what they say it's true,
>
> That is clearly wrong. If writes don't work, nothing works.
>
>> you can't use LVM for anything that needs fsync(), including mail queues
>> (sendmail), mail storage (imapd), as such. So I'd really like to know.
>
> fsync() is a file system call that writes dirty buffers, and then waits
> for the physical writes to complete. It is only the waiting part that
> is broken.
It's a yes or no question... Fsync() either guarantees that the write
is committed to physical media so the application can continue knowing
that it's own transactional expectations are met (i.e. you can crash and
recover that piece of data), or it is broken. If it doesn't wait for
completion, it can't possibly report the correct status.
--
Les Mikesell
lesmikesell at gmail.com
More information about the linux-lvm
mailing list