Commit 32993523 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by James Bottomley

[SCSI] fix SCSI_IOCTL_PROBE_HOST

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: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 48690405
...@@ -30,20 +30,20 @@ ...@@ -30,20 +30,20 @@
#define MAX_BUF PAGE_SIZE #define MAX_BUF PAGE_SIZE
/* /**
* If we are told to probe a host, we will return 0 if the host is not * ioctl_probe -- return host identification
* present, 1 if the host is present, and will return an identifying * @host: host to identify
* string at *arg, if arg is non null, filling to the length stored at * @buffer: userspace buffer for identification
* (int *) arg *
* 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) static int ioctl_probe(struct Scsi_Host *host, void __user *buffer)
{ {
unsigned int len, slen; unsigned int len, slen;
const char *string; const char *string;
int temp = host->hostt->present;
if (temp && buffer) { if (buffer) {
if (get_user(len, (unsigned int __user *) buffer)) if (get_user(len, (unsigned int __user *) buffer))
return -EFAULT; return -EFAULT;
...@@ -59,7 +59,7 @@ static int ioctl_probe(struct Scsi_Host *host, void __user *buffer) ...@@ -59,7 +59,7 @@ static int ioctl_probe(struct Scsi_Host *host, void __user *buffer)
return -EFAULT; return -EFAULT;
} }
} }
return temp; return 1;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment