From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [Bug-tar] --sparse is broken on filesystems where small files may have zero blocks Date: Tue, 29 Oct 2013 10:12:05 -0700 Message-ID: <20131029171205.GA13310@infradead.org> References: <20131028211739.GA26741@ti119.telemetry-investments.com> <526F376E.5030307@cs.ucla.edu> <10978717.9ApR7zKiv0@nb.usersys.redhat.com> <6917534.P50uorHOUu@nb.usersys.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: bug-tar@gnu.org, "Andrew J. Schorr" , Paul Eggert , linux-fsdevel@vger.kernel.org, Andreas Dilger To: Pavel Raiskup Return-path: Received: from bombadil.infradead.org ([198.137.202.9]:43456 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751243Ab3J2RMV (ORCPT ); Tue, 29 Oct 2013 13:12:21 -0400 Content-Disposition: inline In-Reply-To: <6917534.P50uorHOUu@nb.usersys.redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Oct 29, 2013 at 04:27:02PM +0100, Pavel Raiskup wrote: > 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? For XFS we only support inline data for non-regular files at the moment, but for example an inode that has data stored just inline will report zero block, and the unfinished patches to support inline regular file data would logically do the same. As already pointed out by Joerg we do have a proper lseek interface to detect if there are holes.