All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ted Ts'o <tytso@mit.edu>
To: Dave Young <hidave.darkstar@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-ext4@vger.kernel.org
Subject: Re: [BUG] copy file result with zero
Date: Sat, 1 Oct 2011 10:39:00 -0400	[thread overview]
Message-ID: <20111001143900.GH28234@thunk.org> (raw)
In-Reply-To: <CABqxG0feuZCmx=RfxU-50uFK9-P2vNbAMqJUdWM5RhuJifD5Ow@mail.gmail.com>

On Sat, Oct 01, 2011 at 10:01:35PM +0800, Dave Young wrote:
> Hi,
> 
> 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.

> I finally managed to find the way to reproduce this:
> just cp a elf binary A  to file B, then cp B to file C,  then you will get:
> A == B != C
> 
> ie.
> cp /bin/ls ls1
> cp ls1 ls2
> 
> ls2 will be filled with zero

If you add a "sync" between the two copies, does that work around the
problem?  I bet it will...

My suggestion is to upgrade to a newer version of coreutils that
doesn't try to use FIEMAP.

					- Ted

  reply	other threads:[~2011-10-01 14:39 UTC|newest]

Thread overview: 21+ 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 [this message]
2011-10-01 23:37   ` Dave Young
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  7:14           ` Jeff liu
2011-10-02  8:46           ` Dave Young
2011-10-02  8:46             ` Dave Young
2011-10-02 11:54         ` Christoph Hellwig
2011-10-03  9:26         ` Yongqiang Yang
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-02  8:43           ` Dave Young
     [not found]           ` <CABqxG0eMarBn_8xHCOZPq3pae4K01C51Rmxdox7uZr0gWOHGGw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-10-03 11:08             ` Pádraig Brady
2011-10-03 11:08               ` Pádraig Brady

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=20111001143900.GH28234@thunk.org \
    --to=tytso@mit.edu \
    --cc=hidave.darkstar@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.