From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ipmail06.adl6.internode.on.net ([150.101.137.145]:45857 "EHLO ipmail06.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752476AbaHWAcG (ORCPT ); Fri, 22 Aug 2014 20:32:06 -0400 Date: Sat, 23 Aug 2014 10:31:33 +1000 From: Dave Chinner Subject: Re: [PATCH 2/6] common: _scratch_mkfs_sized should inherent default block size from test_dev Message-ID: <20140823003133.GS26465@dastard> References: <1408194791-1797-1-git-send-email-dmonakhov@openvz.org> <1408194791-1797-2-git-send-email-dmonakhov@openvz.org> <20140820231450.GI26465@dastard> <87mwayqooo.fsf@openvz.org> <20140821092344.GK26465@dastard> <877g20r72g.fsf@openvz.org> <20140822150915.GN11085@thunk.org> <874mx4r0eg.fsf@openvz.org> <20140822163712.GP11085@thunk.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140822163712.GP11085@thunk.org> Sender: fstests-owner@vger.kernel.org To: Theodore Ts'o Cc: Dmitry Monakhov , fstests@vger.kernel.org List-ID: On Fri, Aug 22, 2014 at 12:37:12PM -0400, Theodore Ts'o wrote: > On Fri, Aug 22, 2014 at 07:48:07PM +0400, Dmitry Monakhov wrote: > > No, This will not works. Looks like you have missed the point. > > helper has following signature: > > _scratch_mkfs_sized [optional blocksize] > > But mke2fs accept filesystem size accounted in fs-blocks, so in order > > to convert size in blocks to number of blocks we have to figure out blocksize. > > Ah, sorry. I didn't understand what problem you were trying to solve. > > But mke2fs does accept the filesystem size accounted in kilobytes (and > megabytes, gigabytes, etc.). So you could just take the size in > bytes, divide by 1024, and then append 'k', i.e: > > mke2fs $MKFS_OPTS $DEVICE $(expr $bytes / 1024)k Not according to the man page: blocks-count is the number of blocks on the device. Perhaps the documentation needs to be updated to match reality? Cheers, Dave. -- Dave Chinner david@fromorbit.com