Re: [PATCH 2/2] ib_srpt: Make srpt_srq_size module parameter use S_IRUGO|S_IWUSR

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

 



On Sun, Nov 6, 2011 at 12:15 PM, Nicholas A. Bellinger
<nab@xxxxxxxxxxxxxxx> wrote:
> This patch converts the srpt_srq_size module parameter to R/W access
> so that it's accessable when built as CONFIG_INFINIBAND_SRPT=y.  This
> parameter is only referenced within srpt_add_one() directly to set
> srpt_device->srq_size.
>
> Reported-by: Bart Van Assche <bvanassche@xxxxxxx>
> Cc: Bart Van Assche <bvanassche@xxxxxxx>
> Cc: Roland Dreier <roland@xxxxxxxxxxxxxxx>
> Signed-off-by: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
> ---
>  drivers/infiniband/ulp/srpt/ib_srpt.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
> index 94e6aff..43a17e3 100644
> --- a/drivers/infiniband/ulp/srpt/ib_srpt.c
> +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
> @@ -84,7 +84,7 @@ MODULE_PARM_DESC(srp_max_req_size,
>                 "Maximum size of SRP request messages in bytes.");
>
>  static int srpt_srq_size = DEFAULT_SRPT_SRQ_SIZE;
> -module_param(srpt_srq_size, int, 0444);
> +module_param(srpt_srq_size, int, S_IRUGO|S_IWUSR);
>  MODULE_PARM_DESC(srpt_srq_size,
>                 "Shared receive queue (SRQ) size.");

This patch makes it possible to set srpt_srq_size to values that are
so low that communication becomes impossible. Attempts to set
srpt_srq_size below MIN_SRPT_SRQ_SIZE should either be blocked or the
modification shown should be added to the above patch:

-sdev->srq_size = min(srpt_srq_size, sdev->dev_attr.max_srq_wr);
+sdev->srq_size = min(max(srpt_srq_size, MIN_SRPT_SRQ_SIZE),
sdev->dev_attr.max_srq_wr);

Bart.
--
To unsubscribe from this list: 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