From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ur9ZA-00088q-2K for qemu-devel@nongnu.org; Mon, 24 Jun 2013 12:24:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ur9Z3-0007t3-Gk for qemu-devel@nongnu.org; Mon, 24 Jun 2013 12:24:32 -0400 Received: from mx.ipv6.kamp.de ([2a02:248:0:51::16]:33592 helo=mx01.kamp.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Ur9Z3-0007sA-7q for qemu-devel@nongnu.org; Mon, 24 Jun 2013 12:24:25 -0400 Message-ID: <51C872B4.9050301@kamp.de> Date: Mon, 24 Jun 2013 18:24:20 +0200 From: Peter Lieven MIME-Version: 1.0 References: <1371934712-11714-1-git-send-email-pl@kamp.de> <1371934712-11714-8-git-send-email-pl@kamp.de> <51C85808.7000206@redhat.com> <51C86F7D.401@kamp.de> <51C87011.7080404@redhat.com> In-Reply-To: <51C87011.7080404@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 7/8] iscsi: assert that sectors are aligned to LUN blocksize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , ronniesahlberg@gmail.com, qemu-devel@nongnu.org, Stefan Hajnoczi Am 24.06.2013 18:13, schrieb Paolo Bonzini: > Il 24/06/2013 18:10, Peter Lieven ha scritto: >> Am 24.06.2013 16:30, schrieb Paolo Bonzini: >>> Il 22/06/2013 22:58, Peter Lieven ha scritto: >>>> if the blocksize of an iSCSI LUN is bigger than the BDRV_SECTOR_SIZE >>>> it is possible that sector_num or nb_sectors are not correctly >>>> alligned. >>>> >>>> for now assert that there is no misalignment to avoid data >>>> corruption. >>> You should just fail to open the LUN instead. >> Ronnie added support for reading fragments of blocksize if the >> offset is aligned. I don't know what the idea was, maybe for qemu >> reading the boot sector. If the OS does only read multiple of >> blocksize at aligned offsets everything should work. I now that >> our storages support 4K blocksize. I can check if it is usable. >> I could also just fail the operations instead of asserting. > So far, 4K blocksize is usable if you also specify the same block size > for the guest device. I have posted once the patches to do > read-modify-write, but I never really pursued inclusion of those. > > In any case, the right place to fix this is the block layer; > driver-specific hacks are... hacks. :) Where do I find the sector size if not in BDRV_SECTOR_SIZE? Is there a dynamic field or is the answer qemu only support 512 Byte sector size at the moment? So you would go for fail to open a device if the LUN blocksize is not equal to BDRV_SECTOR_SIZE? Peter