From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wanlong Gao Subject: Re: Bug in BLKBSZSET/GET ioctl ? Date: Thu, 29 Dec 2011 12:28:44 +0800 Message-ID: <4EFBEC7C.4060902@cn.fujitsu.com> References: <4EFBE3D1.5030608@cn.fujitsu.com> <20111229042010.GA22132@localhost> Reply-To: gaowanlong@cn.fujitsu.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Wu Fengguang Return-path: In-Reply-To: <20111229042010.GA22132@localhost> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org 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. > 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? Thanks, -Wanlong > example, run a background copy task: > > # cp /dev/sda6 /dev/null & > > # ./util-linux/disk-utils/blockdev --getbsz /dev/sda6 > # ./util-linux/disk-utils/blockdev --setbsz 512 /dev/sda6 > # ./util-linux/disk-utils/blockdev --getbsz /dev/sda6 > > Thanks, > Fengguang >