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


Reply via email to