Bug 421281

Summary: SCSI_IOCTL_SEND_COMMAND, SG_IO and SCSI_IOCTL_GET_IDLUN calls does not work for device mapper multipath devices
Product: Red Hat Enterprise Linux 4 Reporter: Dhananjay Kulkarni <dhananjay_kulkarni>
Component: kernelAssignee: Alasdair Kergon <agk>
Status: CLOSED CURRENTRELEASE QA Contact: Corey Marthaler <cmarthal>
Severity: medium Docs Contact:
Priority: low    
Version: 4.4CC: agk, bmarzins, christophe.varoqui, dwysocha, egoggin, heinzm, junichi.nomura, kueda, lmb, mbroz, prockai, tranlan
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: 4.5.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-12-12 13:34:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dhananjay Kulkarni 2007-12-12 12:38:32 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.9) Gecko/20071105 Fedora/2.0.0.9-1.fc7 Firefox/2.0.0.9

Description of problem:
I have following code to issue SCSI_IOCTL_GET_IDLUN

unsigned int flags = O_RDWR | O_NONBLOCK;
unsigned int status, id[2], deviceId;

deviceId = open(deviceName.c_str(), flags);
status = ioctl (deviceId, SCSI_IOCTL_GET_IDLUN, &id);

This call fails if deviceName is of type /dev/mapper/mpath4
This call is successfull for normal scsi devices. /dev/sdh

# multipath -l mpath4
mpath4 (360060480000290300149533030303743)
[size=4 GB][features="0"][hwhandler="0"]
\_ round-robin 0 [active]
 \_ 1:0:0:92    sdh 8:112  [active][ready]
 \_ 1:0:1:92    sdo 8:224  [active][ready]
 \_ 2:0:0:92    sdx 65:112 [active][ready]

Same is the case of call 

SCSI_IOCTL_SEND_COMMAND - I use this to read SCSI mod pages for device inquiry
SG_IO - I use this to issue SCSI3 Persistent Group Reservation




Version-Release number of selected component (if applicable):
device-mapper-1.02.07-4.0.RHEL4,  device-mapper-1.02.07-4.0.RHEL4, device-mapper-multipath-0.4.5-16.1.RHEL4
device-mapper-multipath-0.4.5-16.1.RHEL4

How reproducible:
Always


Steps to Reproduce:
1. Write code which accepts device path and issue above mentioned IOCTLS
2. Run the code mentioned above by passing device path generated by device-mapper multipath module.


Actual Results:
SCSI_IOCTL_SEND_COMMAND, SG_IO and SCSI_IOCTL_GET_IDLUN device calls fails on /dev/mapper/mpath4

Expected Results:
SCSI_IOCTL_SEND_COMMAND, SG_IO and SCSI_IOCTL_GET_IDLUN calls should pass on /dev/mapper/mpath4 and return appropriate data.

Additional info:

Comment 1 Alasdair Kergon 2007-12-12 13:34:17 UTC
I think we added this support for this to the kernel in 4.5.0: please try that,
and if you still have problems, reopen this.