From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751421Ab1L2ElE (ORCPT ); Wed, 28 Dec 2011 23:41:04 -0500 Received: from mga03.intel.com ([143.182.124.21]:11995 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750785Ab1L2ElD (ORCPT ); Wed, 28 Dec 2011 23:41:03 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.71,315,1320652800"; d="scan'208";a="90416622" Date: Thu, 29 Dec 2011 12:40:59 +0800 From: Wu Fengguang To: Wanlong Gao Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Bug in BLKBSZSET/GET ioctl ? Message-ID: <20111229044058.GA25524@localhost> References: <4EFBE3D1.5030608@cn.fujitsu.com> <20111229042010.GA22132@localhost> <4EFBEC7C.4060902@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4EFBEC7C.4060902@cn.fujitsu.com> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 29, 2011 at 12:28:44PM +0800, Wanlong Gao wrote: > On 12/29/2011 12:20 PM, Wu Fengguang wrote: > > > On Thu, Dec 29, 2011 at 11:51:45AM +0800, Wanlong Gao wrote: > >> Hi all: > >> > >> This is first reported to *libguestfs*: https://bugzilla.redhat.com/show_bug.cgi?id=624335 > >> > >> Then, I looked into upstream util-linux and it seems nothing wrong. I'm not convinced that it's a kernel bug. > >> > >> produce: > >> > >> --- > >> # ./util-linux/disk-utils/blockdev --getbsz /dev/sda6 > >> 4096 > >> # ./util-linux/disk-utils/blockdev --setbsz 2048 /dev/sda6 > >> # ./util-linux/disk-utils/blockdev --getbsz /dev/sda6 > >> 4096 > >> # ./util-linux/disk-utils/blockdev --setbsz 512 /dev/sda6 > >> # ./util-linux/disk-utils/blockdev --getbsz /dev/sda6 > >> 4096 > > > > I think each blockdev invocation is working on a *new* bdev object. > > > But the address of *new* bdev is the same? > I did printk, and they all returned the same address. Then the block size value should be reset in one of the bd_set_size() calls in __blkdev_get(). > > You'll get consistent results if somehow keep it referenced, for > > > But isn't it a bug? It seems that the setbsz has no effect? Yeah, it does look like unexpected behavior to the end user.. Thanks, Fengguang