Re: [PATCH 3/3] null_blk: validated the number of devices

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

 



On 09/12/2019 03:09 PM, André Almeida wrote:
> Hello Matthew,
>
> On 9/12/19 1:19 PM, Matthew Wilcox wrote:
>> On Wed, Sep 11, 2019 at 11:46:36AM -0300, André Almeida wrote:
>>>
>>> -static int nr_devices = 1;
>>> +static unsigned int nr_devices = 1;
>>>   module_param(nr_devices, int, 0444);
>>
>> ^^^ you forgot to change the module_param to match
>>
>>> +	if (!nr_devices) {
>>> +		pr_err("null_blk: invalid number of devices\n");
>>> +		return -EINVAL;
>>> +	}
>>
>> I don't think this is necessary.
>>
>
> Could you explain why you don't think is necessary? As I see, the module
> can't be used without any /dev/nullb* device, so why we should load it?
>
> Thanks,
> 	André
>

I think Matthew is right here. I think module can be loaded with 
nr_devices=0.

Did you get a chance to test nr_device=0 condition ?

Also, did you get a chance to test this patch with all the
possible conditions ?








[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux