Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753215AbcKAQ5d (ORCPT ); Tue, 1 Nov 2016 12:57:33 -0400 Received: from mx2.suse.de ([195.135.220.15]:59364 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752611AbcKAQ5b (ORCPT ); Tue, 1 Nov 2016 12:57:31 -0400 Subject: Re: [PATCH 3/4] loop: Add 'lo_logical_blocksize' To: Christoph Hellwig References: <1477942639-109971-1-git-send-email-hare@suse.de> <1477942639-109971-4-git-send-email-hare@suse.de> <20161101140127.GB16815@lst.de> Cc: Jens Axboe , Alexander Graf , Ming@suse.de, "\"Lei" <"tom.leiming\""@gmail.co>, linux-kernel@vger.kernel.org From: Hannes Reinecke Message-ID: <25f0e1a4-f211-670e-00f8-364b3a85b468@suse.de> Date: Tue, 1 Nov 2016 17:57:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161101140127.GB16815@lst.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1165 Lines: 29 On 11/01/2016 03:01 PM, Christoph Hellwig wrote: > On Mon, Oct 31, 2016 at 08:37:18PM +0100, Hannes Reinecke wrote: >> Add a new field 'lo_logical_blocksize' to hold the logical >> blocksize of the loop device. > > Why do we use the same flag for both block sizes? If there is a good > reason for that it should be documented and both should be in the same > patch. > _Actually_ the flag enables you to set the logical blocksize. However, if you want to set the logical blocksize you also have to set a matching physical blocksize. And the physical blocksize itself isn't settable, rather taken from the underlying device/filesystem/whatever. So the flag itself does not have a dual purpose, it's just out of necessity that you have to set the physical blocksize if you want to change the logical blocksize. And I got pushback when I proposed to set the physical blocksize always, so I made it dependent on the LO_BLOCKSIZE flag, too. Cheers, Hannes -- Dr. Hannes Reinecke zSeries & Storage hare@suse.de +49 911 74053 688 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N?rnberg GF: J. Hawn, J. Guild, F. Imend?rffer, HRB 16746 (AG N?rnberg)