Re: writing file to disk: not as easy as it looks

From: Alan Cox
Date: Wed Dec 03 2008 - 12:53:20 EST

> error reported for one filesystem may belong to the data written by other
> filesystem. So should some flag "there was an error" be set for all
> partitions and report it to every filesystem when it does cache flush? Or
> record the time of the last error in the driver and let the filesystem
> query it (so that the filesystem can tell if the error happened before or
> after it was mounted).

Good question - not working that high up the stack I don't know the right
answer there.
> BTW. how does SCSI report cache flush errors? Does it report them on
> SYNCHRONIZE CACHE command or does it report them on defered senses?

Not sure. I thought the same way.

> Another point is that unless the sector remap table is full, there should
> be no cache flush errors.

You can get them on partial writes to large sector devices, assorted
errors on SSD devices and various 'catastrophic' errors.

> I meant for example loose cable or so --- does it make sense to retry
> indefinitely (until the admin plugs the cable or unmounts the filesystem)
> or return error to the filesystem after few retries?

At the low level we have to return an error so that RAID and the like can

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at