Received: from [140.186.70.92] (port=33910 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Op0oi-0003yF-FL for qemu-devel@nongnu.org; Fri, 27 Aug 2010 11:26:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Op0od-0001aO-Rp for qemu-devel@nongnu.org; Fri, 27 Aug 2010 11:26:08 -0400 Received: from demumfd002.nsn-inter.net ([93.183.12.31]:14254) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Op0oc-0001a0-Tj for qemu-devel@nongnu.org; Fri, 27 Aug 2010 11:26:03 -0400 Message-ID: <4C77D909.9070704@nsn.com> Date: Fri, 27 Aug 2010 17:26:01 +0200 From: Bernhard Kohl MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 4/4] scsi-disk: fix the block descriptor returned by the MODE SENSE command References: <1280763089-11829-1-git-send-email-bernhard.kohl@nsn.com> <1280763089-11829-5-git-send-email-bernhard.kohl@nsn.com> <4C6976A8.3070206@redhat.com> In-Reply-To: <4C6976A8.3070206@redhat.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: ext Kevin Wolf Cc: qemu-devel@nongnu.org Am 16.08.2010 19:34, schrieb ext Kevin Wolf: > > The patch itself looks okay. However, it made me wonder what this line > wants to tell us: > > if ((~dbd) & nb_sectors) { > > Is it just me or doesn't this make any sense at all? dbd is a single > bit, 0x8 if set or 0x0 otherwise. nb_sectors is the number of sectors. > Can this operation have any meaningful result? I suppose it was meant to > be something like: > > if (!dbd && nb_sectors) { > > Can you please check this and add a patch 5/4 if necessary? > For my opinion it is nonsense too. And it does not work. I tested it: root@grml ~ # sg_modes /dev/sdb -6 -v -H -H -p 0x3f inquiry cdb: 12 00 00 00 24 00 QEMU QEMU HARDDISK 0.13 peripheral_type: disk [0x0] mode sense (6) cdb: 1a 00 3f 00 fc 00 mode sense (6): requested 252 bytes but got 220 bytes Mode parameter header from MODE SENSE(6): 00 1f 00 00 08 Mode data length=32, medium type=0x00, WP=0, DpoFua=0, longlba=0 Block descriptor length=8 > Direct access device block descriptors: Density code=0x0 00 00 a0 00 00 00 00 02 00 >> page_code=0x8, page_control=0 00 08 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00 00 root@grml ~ # sg_modes /dev/sdb -6 -v -H -H -p 0x3f -d inquiry cdb: 12 00 00 00 24 00 QEMU QEMU HARDDISK 0.13 peripheral_type: disk [0x0] mode sense (6) cdb: 1a 08 3f 00 fc 00 mode sense (6): requested 252 bytes but got 220 bytes Mode parameter header from MODE SENSE(6): 00 1f 00 00 08 Mode data length=32, medium type=0x00, WP=0, DpoFua=0, longlba=0 Block descriptor length=8 > Direct access device block descriptors: Density code=0x0 00 00 a0 00 00 00 00 02 00 >> page_code=0x8, page_control=0 00 08 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00 00 root@grml ~ # I will add a patch 5/5 in v2 as you proposed. Bernhard