2014-06-25 12:29:01

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH 5/6] scsi: use 64-bit value for 'max_luns'

On Tue, Jun 03, 2014 at 10:58:56AM +0200, Hannes Reinecke wrote:
> Now that we're using 64-bit LUNs internally we need to increase
> the size of max_luns to 64 bits, too.
>
> Signed-off-by: Hannes Reinecke <[email protected]>
> Reviewed-by: Christoph Hellwig <[email protected]>
> Reviewed-by: Ewan Milne <[email protected]>

I just noticed that this has changes to the module param code.
These should be split into a separate patch and be ACKed by the modules
maintainer. I'd still love to take the change through the SCSI tree to
be able to get this into 3.17 easily.

moduleparam changes below:

> diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
> index 204a677..21e2ba6 100644
> --- a/include/linux/moduleparam.h
> +++ b/include/linux/moduleparam.h
> @@ -381,6 +381,11 @@ extern int param_set_ulong(const char *val, const struct kernel_param *kp);
> extern int param_get_ulong(char *buffer, const struct kernel_param *kp);
> #define param_check_ulong(name, p) __param_check(name, p, unsigned long)
>
> +extern struct kernel_param_ops param_ops_ullong;
> +extern int param_set_ullong(const char *val, const struct kernel_param *kp);
> +extern int param_get_ullong(char *buffer, const struct kernel_param *kp);
> +#define param_check_ullong(name, p) __param_check(name, p, unsigned long long)
> +
> extern struct kernel_param_ops param_ops_charp;
> extern int param_set_charp(const char *val, const struct kernel_param *kp);
> extern int param_get_charp(char *buffer, const struct kernel_param *kp);

> diff --git a/kernel/params.c b/kernel/params.c
> index b00142e..2b2a9dd 100644
> --- a/kernel/params.c
> +++ b/kernel/params.c
> @@ -253,6 +253,7 @@ STANDARD_PARAM_DEF(int, int, "%i", kstrtoint);
> STANDARD_PARAM_DEF(uint, unsigned int, "%u", kstrtouint);
> STANDARD_PARAM_DEF(long, long, "%li", kstrtol);
> STANDARD_PARAM_DEF(ulong, unsigned long, "%lu", kstrtoul);
> +STANDARD_PARAM_DEF(ullong, unsigned long long, "%llu", kstrtoull);
>
> int param_set_charp(const char *val, const struct kernel_param *kp)
> {
> --
> 1.7.12.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
---end quoted text---


2014-06-25 12:31:37

by Hannes Reinecke

[permalink] [raw]
Subject: Re: [PATCH 5/6] scsi: use 64-bit value for 'max_luns'

On 06/25/2014 02:28 PM, Christoph Hellwig wrote:
> On Tue, Jun 03, 2014 at 10:58:56AM +0200, Hannes Reinecke wrote:
>> Now that we're using 64-bit LUNs internally we need to increase
>> the size of max_luns to 64 bits, too.
>>
>> Signed-off-by: Hannes Reinecke <[email protected]>
>> Reviewed-by: Christoph Hellwig <[email protected]>
>> Reviewed-by: Ewan Milne <[email protected]>
>
> I just noticed that this has changes to the module param code.
> These should be split into a separate patch and be ACKed by the modules
> maintainer. I'd still love to take the change through the SCSI tree to
> be able to get this into 3.17 easily.
>
> moduleparam changes below:
>
Guess I need to redo the patchset yet again ...
Oh well.

Cheers,

Hannes
--
Dr. Hannes Reinecke zSeries & Storage
[email protected] +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: J. Hawn, J. Guild, F. Imend?rffer, HRB 16746 (AG N?rnberg)

2014-06-25 12:33:40

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH 5/6] scsi: use 64-bit value for 'max_luns'

On Wed, Jun 25, 2014 at 02:31:31PM +0200, Hannes Reinecke wrote:
> Guess I need to redo the patchset yet again ...

If you plan to resend it please also include these fixes for the
mptfusion driver:


diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c
index 02a3eef..bf2a2ce 100644
--- a/drivers/message/fusion/mptfc.c
+++ b/drivers/message/fusion/mptfc.c
@@ -204,7 +204,7 @@ mptfc_block_error_handler(struct scsi_cmnd *SCpnt,
|| (loops > 0 && ioc->active == 0)) {
spin_unlock_irqrestore(shost->host_lock, flags);
dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT
- "mptfc_block_error_handler.%d: %d:%d, port status is "
+ "mptfc_block_error_handler.%d: %d:%llu, port status is "
"%x, active flag %d, deferring %s recovery.\n",
ioc->name, ioc->sh->host_no,
SCpnt->device->id, SCpnt->device->lun,
@@ -218,7 +218,7 @@ mptfc_block_error_handler(struct scsi_cmnd *SCpnt,
if (ready == DID_NO_CONNECT || !SCpnt->device->hostdata
|| ioc->active == 0) {
dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT
- "%s.%d: %d:%d, failing recovery, "
+ "%s.%d: %d:%llu, failing recovery, "
"port state %x, active %d, vdevice %p.\n", caller,
ioc->name, ioc->sh->host_no,
SCpnt->device->id, SCpnt->device->lun, ready,
@@ -226,7 +226,7 @@ mptfc_block_error_handler(struct scsi_cmnd *SCpnt,
return FAILED;
}
dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT
- "%s.%d: %d:%d, executing recovery.\n", caller,
+ "%s.%d: %d:%llu, executing recovery.\n", caller,
ioc->name, ioc->sh->host_no,
SCpnt->device->id, SCpnt->device->lun));
return (*func)(SCpnt);
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index 82d991d..5b06d68 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -536,7 +536,7 @@ mptscsih_info_scsiio(MPT_ADAPTER *ioc, struct scsi_cmnd *sc, SCSIIOReply_t * pSc
}

scsi_print_command(sc);
- printk(MYIOC_s_DEBUG_FMT "\tfw_channel = %d, fw_id = %d, lun = %d\n",
+ printk(MYIOC_s_DEBUG_FMT "\tfw_channel = %d, fw_id = %d, lun = %llu\n",
ioc->name, pScsiReply->Bus, pScsiReply->TargetID, sc->device->lun);
printk(MYIOC_s_DEBUG_FMT "\trequest_len = %d, underflow = %d, "
"resid = %d\n", ioc->name, scsi_bufflen(sc), sc->underflow,
@@ -1155,7 +1155,7 @@ mptscsih_report_queue_full(struct scsi_cmnd *sc, SCSIIOReply_t *pScsiReply, SCSI
return;
ioc = hd->ioc;
if (time - hd->last_queue_full > 10 * HZ) {
- dprintk(ioc, printk(MYIOC_s_WARN_FMT "Device (%d:%d:%d) reported QUEUE_FULL!\n",
+ dprintk(ioc, printk(MYIOC_s_WARN_FMT "Device (%d:%d:%llu) reported QUEUE_FULL!\n",
ioc->name, 0, sc->device->id, sc->device->lun));
hd->last_queue_full = time;
}
@@ -2380,7 +2380,7 @@ mptscsih_slave_configure(struct scsi_device *sdev)
vdevice = sdev->hostdata;

dsprintk(ioc, printk(MYIOC_s_DEBUG_FMT
- "device @ %p, channel=%d, id=%d, lun=%d\n",
+ "device @ %p, channel=%d, id=%d, lun=%llu\n",
ioc->name, sdev, sdev->channel, sdev->id, sdev->lun));
if (ioc->bus_type == SPI)
dsprintk(ioc, printk(MYIOC_s_DEBUG_FMT

2014-07-09 00:35:46

by Rusty Russell

[permalink] [raw]
Subject: Re: [PATCH 5/6] scsi: use 64-bit value for 'max_luns'

Christoph Hellwig <[email protected]> writes:
> On Tue, Jun 03, 2014 at 10:58:56AM +0200, Hannes Reinecke wrote:
>> Now that we're using 64-bit LUNs internally we need to increase
>> the size of max_luns to 64 bits, too.
>>
>> Signed-off-by: Hannes Reinecke <[email protected]>
>> Reviewed-by: Christoph Hellwig <[email protected]>
>> Reviewed-by: Ewan Milne <[email protected]>
>
> I just noticed that this has changes to the module param code.
> These should be split into a separate patch and be ACKed by the modules
> maintainer. I'd still love to take the change through the SCSI tree to
> be able to get this into 3.17 easily.
>
> moduleparam changes below:
>
>> diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
>> index 204a677..21e2ba6 100644
>> --- a/include/linux/moduleparam.h
>> +++ b/include/linux/moduleparam.h
>> @@ -381,6 +381,11 @@ extern int param_set_ulong(const char *val, const struct kernel_param *kp);
>> extern int param_get_ulong(char *buffer, const struct kernel_param *kp);
>> #define param_check_ulong(name, p) __param_check(name, p, unsigned long)
>>
>> +extern struct kernel_param_ops param_ops_ullong;
>> +extern int param_set_ullong(const char *val, const struct kernel_param *kp);
>> +extern int param_get_ullong(char *buffer, const struct kernel_param *kp);
>> +#define param_check_ullong(name, p) __param_check(name, p, unsigned long long)
>> +
>> extern struct kernel_param_ops param_ops_charp;
>> extern int param_set_charp(const char *val, const struct kernel_param *kp);
>> extern int param_get_charp(char *buffer, const struct kernel_param *kp);
>
>> diff --git a/kernel/params.c b/kernel/params.c
>> index b00142e..2b2a9dd 100644
>> --- a/kernel/params.c
>> +++ b/kernel/params.c
>> @@ -253,6 +253,7 @@ STANDARD_PARAM_DEF(int, int, "%i", kstrtoint);
>> STANDARD_PARAM_DEF(uint, unsigned int, "%u", kstrtouint);
>> STANDARD_PARAM_DEF(long, long, "%li", kstrtol);
>> STANDARD_PARAM_DEF(ulong, unsigned long, "%lu", kstrtoul);
>> +STANDARD_PARAM_DEF(ullong, unsigned long long, "%llu", kstrtoull);

Thanks Christoph!

Acked-by: Rusty Russell <[email protected]>

Cheers,
Rusty.