From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752462Ab1JBLyu (ORCPT ); Sun, 2 Oct 2011 07:54:50 -0400 Received: from 173-166-109-252-newengland.hfc.comcastbusiness.net ([173.166.109.252]:43262 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752196Ab1JBLyo (ORCPT ); Sun, 2 Oct 2011 07:54:44 -0400 Date: Sun, 2 Oct 2011 07:54:38 -0400 From: Christoph Hellwig To: Andreas Dilger Cc: Jeff liu , Yongqiang Yang , Dave Young , "Ted Ts'o" , Linux Kernel Mailing List , linux-ext4@vger.kernel.org Subject: Re: [BUG] copy file result with zero Message-ID: <20111002115438.GA24073@infradead.org> References: <20111001143900.GH28234@thunk.org> <89E75765-AC24-4EF4-9547-6EE7A1A38B5A@dilger.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <89E75765-AC24-4EF4-9547-6EE7A1A38B5A@dilger.ca> User-Agent: Mutt/1.5.21 (2010-09-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 02, 2011 at 12:59:22AM -0700, Andreas Dilger wrote: > My understanding is that cp uses the blocks count to determine whether the file is sparse or not. In the case of delayed allocation (where blocks are not yet allocated, if they are not reflected in the i_blocks count) it might mistakenly think that the file is sparse. Ext4 fortunatley is smart enough to add the delalloc blocks to st_blocks for state, just like all other filesystems implementing delayed allocations.