Skip to content

Commit

Permalink
[SCSI] fix SCSI_IOCTL_PROBE_HOST
Browse files Browse the repository at this point in the history
This returns always false with new-style drivers right now.  Make it
return always true instead, as a host must be present if we are able
to call the ioctl (without a host attached there would be no device
node to call on..)

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
  • Loading branch information
Christoph Hellwig authored and James Bottomley committed Sep 6, 2005
1 parent 4869040 commit 3299352
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions drivers/scsi/scsi_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@

#define MAX_BUF PAGE_SIZE

/*
* If we are told to probe a host, we will return 0 if the host is not
* present, 1 if the host is present, and will return an identifying
* string at *arg, if arg is non null, filling to the length stored at
* (int *) arg
/**
* ioctl_probe -- return host identification
* @host: host to identify
* @buffer: userspace buffer for identification
*
* Return an identifying string at @buffer, if @buffer is non-NULL, filling
* to the length stored at * (int *) @buffer.
*/

static int ioctl_probe(struct Scsi_Host *host, void __user *buffer)
{
unsigned int len, slen;
const char *string;
int temp = host->hostt->present;

if (temp && buffer) {
if (buffer) {
if (get_user(len, (unsigned int __user *) buffer))
return -EFAULT;

Expand All @@ -59,7 +59,7 @@ static int ioctl_probe(struct Scsi_Host *host, void __user *buffer)
return -EFAULT;
}
}
return temp;
return 1;
}

/*
Expand Down

0 comments on commit 3299352

Please sign in to comment.