tech-kern archive

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

Re: syncing a directory



On Thu, Jul 10, 2008 at 01:17:46PM -0500, David Young wrote:
> On Thu, Jul 10, 2008 at 07:58:52PM +0200, Manuel Bouyer wrote:
> > On Thu, Jul 10, 2008 at 12:50:56PM -0500, David Young wrote:
> > > > Actually, we do have that: fsync_range(fd, FDISKSYNC, ...).
> > > 
> > > I thought while we do have an API, we do not have a reliable
> > > implementation, because we cannot reliably flush the write cache on
> > > many disks, especially those that are connected through inexpensive
> > > USB->IDE adapters.
> > 
> > it's true. Some (old) IDE disks also don't have the FLUSH_CACHE command.
> > In such cases I can't see what improvements could be done. It's not the
> > implementation which is unreliable, it's the hardware.
> 
> Do the disks reliably indicate that FLUSH_CACHE is not supported with
> either a capabilities flag or an error code?

We have a capability bit for it. We're already using it (returning
ENODEV if WDCC_FLUSHCACHE is not supported).

> 
> I think that the fsync_range() implementation is unreliable if it does
> not fail (EIO) when the hardware has not fulfilled the request.

However I don't know how fsync_range() implemented in ATA or SCSI drivers.
Does it use DIOCCACHESYNC ?

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index