dpt_i2o and sd driver's problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear Mark,

When I was using MO device , following messages showed in
our /var/log/messages.
The kernel version is kernel-2.6.16.16.

kernel: Cmd len 00001000 Cmd underflow 00000400

This messages is reported from dpt_i2o driver.
It is reported when request_bufflen member/underflow member
of the Scsi_Cmnd structure is not match.
---------------------------------------
dpt_i2o.c
static s32 adpt_scsi_to_i2o(adpt_hba* pHba,
                            Scsi_Cmnd* cmd, struct adpt_device* d)
{
                :
        len = cmd->request_bufflen;
                :
        if(cmd->underflow && len != cmd->underflow){
                printk(KERN_WARNING"Cmd len %08X Cmd underflow %08X\n",
                        len, cmd->underflow);
        }
                :
}
---------------------------------------

The request_bufflen member/underflow member is set in sd driver.
But, each sector size is not match except 512 bytes.
---------------------------------------
sd.c
static int sd_init_command(Scsi_Cmnd * SCpnt)
{
                :
        this_count = SCpnt->request_bufflen >> 9;
                :
        if (sdp->sector_size == 1024) {
                if ((block & 1) || (rq->nr_sectors & 1)) {
                        printk(KERN_ERR "sd: Bad block number requested");
                        return 0;
                } else {
                        block = block >> 1;
                        this_count = this_count >> 1;
                }
        }
        if (sdp->sector_size == 2048) {
                if ((block & 3) || (rq->nr_sectors & 3)) {
                        printk(KERN_ERR "sd: Bad block number requested");
                        return 0;
                } else {
                        block = block >> 2;
                        this_count = this_count >> 2;
                }
        }
        if (sdp->sector_size == 4096) {
                if ((block & 7) || (rq->nr_sectors & 7)) {
                        printk(KERN_ERR "sd: Bad block number requested");
                        return 0;
                } else {
                        block = block >> 3;
                        this_count = this_count >> 3;
                }
        }
                :
        SCpnt->underflow = this_count << 9;
}
---------------------------------------

There are no problem for the hard disk because of 512 bytes in the sector size.
But, when I tested MO media(1.3GB), the sector size was 2048 byte.

I have 2 questions.

1. I think the value of underflow is a calculation mistake.
   Is it true?

2. What is the purpose to compare the values of
   request_bufflen member/underflow member with dpt_i2o driver?


I'm not participated in the linux-scsi mailing list.
Please reply to the following addresses. 

    E-Mail : sakurai_hiro@xxxxxxxxxxxxxxxx

Best Regards
Hiroomi Sakurai



-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux