From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36958 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751301AbeFAMiF (ORCPT ); Fri, 1 Jun 2018 08:38:05 -0400 Date: Fri, 1 Jun 2018 08:38:04 -0400 From: Vivek Goyal Subject: Re: [PATCH V3] xfstest: overlay: Add tests for overlay metadata only copy up feature Message-ID: <20180601123804.GA3259@redhat.com> References: <20180529194108.GB13363@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: fstests-owner@vger.kernel.org To: Amir Goldstein Cc: fstests , overlayfs , Miklos Szeredi , Eryu Guan List-ID: On Fri, Jun 01, 2018 at 11:34:38AM +0300, Amir Goldstein wrote: [..] > > +# File size on lower > > +lowername="lowerfile" > > +lowerlink="lowerfile-link" > > +lowerdata="lower" > > +lowerblocks="32" > > +lowersize=$(( $lowerblocks * 512 )) > > + > > Although the test passes now on ext4/xfs, my comment remains - > it makes no sense for this test to calculate expected nr of blocks > instead of using actual lower file blocks. > > While fallocate $size guaranties that resulting file size is $size > you cannot say the same about $blocks. There is no guarantie > that file systems will use $size / 512 blocks to store size$. > file systems can and do allocate more blocks for e.g. xattr and > other file metadata. There is really no reason for this test to > make the assumption about $blocks however probable it may be. Ok. So instead of making assumptions about number of blocks, instead, create a file of pre-determined size, and then query the number of blocks from lower and use that as expected blocks from overlay mount? Will make that change. Thanks. Vivek