From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Raiskup 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 Message-ID: <6917534.P50uorHOUu@nb.usersys.redhat.com> References: <20131028211739.GA26741@ti119.telemetry-investments.com> <526F376E.5030307@cs.ucla.edu> <10978717.9ApR7zKiv0@nb.usersys.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: "Andrew J. Schorr" , Paul Eggert , linux-fsdevel@vger.kernel.org, Andreas Dilger To: bug-tar@gnu.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:10453 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752086Ab3J2P1I convert rfc822-to-8bit (ORCPT ); Tue, 29 Oct 2013 11:27:08 -0400 In-Reply-To: <10978717.9ApR7zKiv0@nb.usersys.redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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_NBLOCKSIZ= E !=3D 0))) > > + < ((st).st_size / ST_NBLOCKSIZE \ > > + + ((st).st_size % ST_NBLOCKSIZE !=3D 0 \ > > + && (st).st_size / ST_NBLOCKSIZE !=3D 0))) >=20 > May the st.st_size / ST_NBLOCKSIZE be greater than 1 and data still s= tored > in inode directly? Seems like on ext4 filesystem it is not possible = [1] > but does anybody know about exception? >=20 > [1] https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#Inline_Da= ta Well, I now recalled somehow relevant Red Hat bug, sorry I have not mentioned it before: https://bugzilla.redhat.com/show_bug.cgi?id=3D757557 CC'ing fs-devel: The question is whether that ^^^^ is not a bug in filesystem =E2=80=94 whether filesystem should not _always_ return to f= stat() block count at least 1 if there are at least some data (even if these d= ata are inlined in inode)? Just for catching the context, this thread star= ts 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