Re: [PATCH - 2.6.10] generic_file_buffered_write handle partial DIO writes with multiple iovecs

From: Sami Farin
Date: Tue Jan 18 2005 - 21:33:16 EST


On Tue, Jan 18, 2005 at 05:22:44PM -0800, Daniel McNeil wrote:
> Andrew,
>
> This is a patch to generic_file_buffered_write() to correctly
> handle partial O_DIRECT writes (because of unallocated blocks)
> when there is more than 1 iovec. Without this patch, the code is
> writing the wrong iovec (it writes the first iovec a 2nd time).
>
> Included is a test program dio_bug.c that shows the problem by:
> writing 4k to offset 4k
> writing 4k to offset 12k
> writing 8k to offset 4k
> The result is that 8k write writes the 1st 4k of the buffer twice.
>
> $ rm f; ./dio_bug f
> wrong value offset 8k expected 0x33 got 0x11
> wrong value offset 10k expected 0x44 got 0x22
>
> with patch
> $ rm f; ./dio_bug f

I have Linux 2.6.10-ac9 + bio clone memory corruption -patch,
and dio_bug does not give errors (without your patch).

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/