Re: [PATCH 06/20] staging/lustre: fix comparison between signed and unsigned

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

 



On Feb 2, 2015, at 3:51 PM, Greg Kroah-Hartman wrote:
> On Mon, Feb 02, 2015 at 03:25:58PM -0500, Oleg Drokin wrote:
>>> What is this code supposed to be protecting from?  And -1?  That should
>>> never be a return value…
>> 
>> Why is -1 a bad return value if all callsites check for that as an
>> indication of error?
> 
> Because you should use "real" error values, don't make them up with
> random negative numbers that mean nothing.
> 
>> (granted there's only one caller at this point in kernel space:
>> lustre/llite/dir.c::ll_dir_ioctl()
>>                totalsize = hur_len(hur);
>>                OBD_FREE_PTR(hur);
>>                if (totalsize < 0)
>>                        return -E2BIG;
>> )
> 
> Shouldn't you have returned the error that hur_len() passed you?

Ok, I guess that makes quite a bit of sense too.

I'll do an updated patch about that later on then.

Thanks!

Bye,
    Oleg
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel





[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux