Re: target: Fix excessive stack usage

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

 



On Fri, 2011-01-07 at 17:32 +0100, Rolf Eike Beer wrote:
> James Bottomley wrote:
> 
> > @@ -1870,6 +1870,10 @@ static int __core_scsi3_update_aptpl_buf(
> >  				"No Registrations or Reservations\n");
> >  		return 0;
> >  	}
> > +	tmp = kmalloc(1024, GFP_KERNEL);
> > +	if (!tmp)
> > +		return -1;
> 
> Shouldn't this return useful errorcodes all over the place instead of just -1? 
> Like -ENOMEM?
> 

Hi Eike,

So I ended up dropping this allocation from James' original patch in
favour of shrinking the local stack usage for tmp from 1024 to 512 bytes
in order to avoid the extra kmalloc() here..

However there are still a number of cases in target_core_pr.c code where
we 'return -1' to signal a failure.  This was originally because these
failures never get propagated to any code that makes sense of errno, and
all of the conditional checks are looking for a non zero return.

So IMHO changing this does not provide much benefit, but I would still
accept a patch if you are interested.  ;)

Best,

--nab


--
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