linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Raiskup <praiskup@redhat.com>
To: bug-tar@gnu.org
Cc: "Andrew J. Schorr" <aschorr@telemetry-investments.com>,
	Paul Eggert <eggert@cs.ucla.edu>,
	linux-fsdevel@vger.kernel.org, Andreas Dilger <adilger@dilger.ca>
Subject: Re: [Bug-tar] --sparse is broken on filesystems where small files may have zero blocks
Date: Tue, 29 Oct 2013 16:27:02 +0100	[thread overview]
Message-ID: <6917534.P50uorHOUu@nb.usersys.redhat.com> (raw)
In-Reply-To: <10978717.9ApR7zKiv0@nb.usersys.redhat.com>

On Tuesday, October 29, 2013 09:59:56 Pavel Raiskup wrote:
> >  #define ST_IS_SPARSE(st)                                  \
> >    (ST_NBLOCKS (st)                                        \
> > -    < ((st).st_size / ST_NBLOCKSIZE + ((st).st_size % ST_NBLOCKSIZE != 0)))
> > +   < ((st).st_size / ST_NBLOCKSIZE			  \
> > +      + ((st).st_size % ST_NBLOCKSIZE != 0		  \
> > +	 && (st).st_size / ST_NBLOCKSIZE != 0)))
> 
> May the st.st_size / ST_NBLOCKSIZE be greater than 1 and data still stored
> in inode directly?  Seems like on ext4 filesystem it is not possible [1]
> but does anybody know about exception?
> 
> [1] https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#Inline_Data

Well, I now recalled somehow relevant Red Hat bug, sorry I have not
mentioned it before:
  https://bugzilla.redhat.com/show_bug.cgi?id=757557

CC'ing fs-devel:  The question is whether that ^^^^ is not a bug in
filesystem — whether filesystem should not _always_ return to fstat()
block count at least 1 if there are at least some data (even if these data
are inlined in inode)?  Just for catching the context, this thread starts
here: http://lists.gnu.org/archive/html/bug-tar/2013-10/msg00030.html

If that is not a bug in fs, is there possible to detect that particular
file is completely sparse?

Pavel

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

       reply	other threads:[~2013-10-29 15:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20131028211739.GA26741@ti119.telemetry-investments.com>
     [not found] ` <526F376E.5030307@cs.ucla.edu>
     [not found]   ` <10978717.9ApR7zKiv0@nb.usersys.redhat.com>
2013-10-29 15:27     ` Pavel Raiskup [this message]
2013-10-29 15:32       ` --sparse is broken on filesystems where small files may have zero blocks Joerg Schilling
2013-10-29 17:12       ` [Bug-tar] " Christoph Hellwig
2013-10-29 17:37       ` Jan Kara
2013-10-29 22:01         ` Andreas Dilger
2013-10-31 12:11           ` Carlos Maiolino

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=6917534.P50uorHOUu@nb.usersys.redhat.com \
    --to=praiskup@redhat.com \
    --cc=adilger@dilger.ca \
    --cc=aschorr@telemetry-investments.com \
    --cc=bug-tar@gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=linux-fsdevel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).