bug-coreutils
[Top][All Lists]
Advanced

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

bug#21790: [PATCH] coreutils/cp: handle EOF extents correctly


From: Pádraig Brady
Subject: bug#21790: [PATCH] coreutils/cp: handle EOF extents correctly
Date: Fri, 30 Oct 2015 16:57:04 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 30/10/15 09:02, Dmitry Monakhov wrote:
> fallocate can allocate extens beyond EOF via FALLOC_FL_KEEP_SIZE.
> Currenly sparse engine tries to copy such extents which is wrong and
> result in silent data corruption (leave file with incorrect size).
> 
> ##TESTCASE
> echo blabla > sparse_falloc.in
> truncate -s 2M sparse_falloc.in
> fallocate -n -o 4M -l 1M sparse_falloc.in
> cp sparse_falloc.in sparse_falloc.out
> cmp sparse_falloc.in sparse_falloc.out

Ouch.  Thanks for the analysis and patch.
It looks correct.  I'll analyze further before applying.

thanks!
Pádraig.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]