Re: [PATCH] Fix soft lockup with iSeries viocd driver

From: Stephen Rothwell
Date: Thu Mar 01 2007 - 03:49:11 EST


On Thu, 1 Mar 2007 00:37:48 -0800 Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> On Thu, 1 Mar 2007 14:56:40 +1100 tony@xxxxxxxxxxxxxxxxxx (Tony Breeds) wrote:
>
> > From: Tony Breeds <tony@xxxxxxxxxxxxxxxxxx>
> >
> > Fix soft lockup with iSeries viocd driver, caused by eventually calling
> > end_that_request_first() with nr_bytes 0.
> >
> > The lockup is triggered by hald, interrogating the device.
> >
>
> What causes the lockup, and how does this patch fix it?

Some versions of hald do an SG_IO ioctl on the viocd device which becomes
a request with hard_nr_sectors and hard_cur_sectors set to zero. Passing
zero as the number of sectors to end_request() (which calls
end_that_request_first()) causes an infinite loop when the bio is being
freed. This patch makes sure that the zero is never passed. It only
requires some number larger the the request size the terminate the loop.

--
Cheers,
Stephen Rothwell sfr@xxxxxxxxxxxxxxxx
http://www.canb.auug.org.au/~sfr/

Attachment: pgp00000.pgp
Description: PGP signature