public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Pádraig Brady" <P@draigBrady.com>
To: Dave Young <hidave.darkstar@gmail.com>
Cc: Andreas Dilger <aedilger@gmail.com>,
	Jeff liu <jeff.liu@oracle.com>, "Ted Ts'o" <tytso@mit.edu>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-ext4 development <linux-ext4@vger.kernel.org>,
	Coreutils <coreutils@gnu.org>
Subject: Re: [BUG] copy file result with zero
Date: Mon, 03 Oct 2011 12:08:58 +0100	[thread overview]
Message-ID: <4E8997CA.7060404@draigBrady.com> (raw)
In-Reply-To: <CABqxG0eMarBn_8xHCOZPq3pae4K01C51Rmxdox7uZr0gWOHGGw@mail.gmail.com>

On 10/02/2011 09:43 AM, Dave Young wrote:
> On Sun, Oct 2, 2011 at 4:02 PM, Andreas Dilger <aedilger@gmail.com> wrote:
>> On 2011-10-01, at 11:41 PM, Jeff liu wrote:
>>>> On Sat, Oct 1, 2011 at 10:39 PM, Ted Ts'o <tytso@mit.edu> wrote:
>>>>> On Sat, Oct 01, 2011 at 10:01:35PM +0800, Dave Young wrote:
>>>>>> Weird problem, when I build app from source,
>>>>>> make; make install
>>>>>> run the command, but got "cannot execute binary file"
>>>>>>
>>>>>> hexdump shows the installed binary is full of zero
>>>>>>
>>>>>> Is it related to ext4 fiemap problem described below?
>>>>>> http://lwn.net/Articles/429349/
>>>>>
>>>>> There is general agreement that /bin/cp should not have been relying
>>>>> on FIEMAP, and I believe the more recent versions of /bin/cp have
>>>>> removed that code by default pending implementation of
>>>>> SEEK_HOLE/SEEK_DATA.  That being said, ext4 had a workaround to its
>>>>> FIEMAP implementation that landed in 2.6.39, and you're using
>>>>> 3.1.0-rc6.
>>>
>>> Actually, upstream cp(1) using FIEMAP only if the source file is sparse,  or else, it will do normal copy, i.e, block based.
>>
>> Are there any distros that are shipping with a version of cp that depends on FIEMAP?  That would dramatically increase the severity of this problem, since orders of magnitude more users will hit the problem.
> 
> I'm not sure if it depends on FIEMAP, I think it should be not so old.
> 
>>
>> Dave, what distro were you seeing this problem on, and had you installed/upgraded your coreutils and/or kernel yourself?
> 
> Slackware 13.37, coreutils 8.11
> kernel is always built from linus's git by myself

Coreutils 8.11 was only released for 13 days,
before 8.12 was released specifically to avoid this issue.
Slackware should update.

Coreutils 8.12 only uses a fiemap based copy for
sparse files, where it will do a sync first.
The sparseness heuristic is st_blocks < st_size / st_blksize

cheers,
Pádraig.

      reply	other threads:[~2011-10-03 11:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-01 14:01 [BUG] copy file result with zero Dave Young
2011-10-01 14:39 ` Ted Ts'o
2011-10-01 23:37   ` Dave Young
2011-10-02  6:41     ` Jeff liu
2011-10-02  7:59       ` Andreas Dilger
2011-10-02  7:14         ` Jeff liu
2011-10-02  8:46           ` Dave Young
2011-10-02 11:54         ` Christoph Hellwig
2011-10-03  9:26         ` Yongqiang Yang
2011-10-03 13:11           ` Lukas Czerner
2011-10-03 14:18             ` Ted Ts'o
2011-10-03 15:51               ` Lukas Czerner
2011-10-02  8:02       ` Andreas Dilger
2011-10-02  8:43         ` Dave Young
2011-10-03 11:08           ` Pádraig Brady [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E8997CA.7060404@draigBrady.com \
    --to=p@draigbrady.com \
    --cc=aedilger@gmail.com \
    --cc=coreutils@gnu.org \
    --cc=hidave.darkstar@gmail.com \
    --cc=jeff.liu@oracle.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox