Re: POSIX violation by writeback error
From: Alan Cox
Date: Wed Sep 26 2018 - 14:11:10 EST
> And I think that's fine. The only way we can make any guarantees is
> if we do what Alan suggested, which is to imply that a read on a dirty
> page *block* until the the page is successfully written back. This
> would destroy performance.
In almost all cases you don't care so you wouldn't use it. In those cases
where it might matter it's almost always the case that a reader won't
consume it before it hits the media.
That's why I suggested having an fbarrier() so you can explicitly say 'in
the even that case does happen then stall and write it'. It's kind of
lazy fsync. That can be used with almost no cost by things like mail
daemons. Another way given that this only really makes sense with locks
is to add that fbarrier notion as a file locking optional semantic so you
can 'unlock with barrier' and 'lock with barrier honoured'
Alan