I lost track of this email, sorry for the very late response.

On Thu, Oct 20, 2016 at 09:47:52PM +0100, Andrew Wood wrote:
> I agree that this sounds like a good idea but there are some complications. 
> What if we get an error while half-way through a block, because the disk is
> failing but not wholly failed?

BTW: If -E is given the actual disk sector size, that can't happen. Also,
unless using O_DIRECT, I believe it can't happen on Linux if it's given
the page size (even if disk sectors are smaller).

> Do we skip a whole block, to half-way
> through the next block, or only skip to the start of the next block?  How do
> we know where the next block is?  Can we safely assume that all files on all
> filesystems always start at the beginning of a block?

On almost every filesystem, yes. At least for files of non-trivial size.
The performance of partial-sector writes is bad (forces an extra read
first), so filesystems avoid that. The only exceptions you're likely to
see are filesystems designed for tiny flash (embedded) and FUSE stuff
(e.g., read-only access to archives).

> 
> So perhaps if -E took an argument, we would explicitly state in the
> documentation that on error, PV would skip to the start of the next block,
> and would assume that the file starts at the beginning of a block.  So with
> "-E 4k", an error at 2k would skip to 4k, an error at 4k would skip to 8k,
> and so on.
> 
> Does this seem reasonable?

That sounds reasonable. Sensible, even.

-- 
A committee is a life form with six or more legs and no brain.
                -- Lazarus Long, "Time Enough For Love"

Reply via email to