GNU bug report logs - #21790
[PATCH] coreutils/cp: handle EOF extents correctly

Previous Next

Package: coreutils;

Reported by: Dmitry Monakhov <dmonakhov <at> openvz.org>

Date: Fri, 30 Oct 2015 16:02:01 UTC

Severity: normal

Tags: patch

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Pádraig Brady <P <at> draigBrady.com>
To: Dmitry Monakhov <dmonakhov <at> openvz.org>, 21790 <at> debbugs.gnu.org
Cc: vvs <at> parallels.com, devel <at> openvz.org
Subject: bug#21790: [PATCH] coreutils/cp: handle EOF extents correctly
Date: Fri, 30 Oct 2015 16:57:04 +0000
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.





This bug report was last modified 9 years and 185 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.