Re: [PATCH 1/2] sg: fix races during device removal (v5)

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

 



Tony Battersby wrote:
> I think BUG_ON is
> the best way to go for this instead of printk/return because bugs
> will be noticed and fixed instead of possibly going unnoticed.
...
>  static void sg_rq_end_io(struct request *rq, int uptodate)
>  {
...
> +	int result, resid, done = 1;
> +
> +	BUG_ON(srp->done != 0);

AFAIU this is typically called in atomic context.  If so, WARN_ON is
preferred.

...
> +	BUG_ON(sfp == NULL);
> +
> +	sdp = sfp->parentdp;

This would bring up a NULL pointer dereference dump anyway.
-- 
Stefan Richter
-=====-==--= ---= =-=-=
http://arcgraph.de/sr/
--
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