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: r...@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 r...@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 r...@grml ~ # I will add a patch 5/5 in v2 as you proposed. Bernhard