Re: [bug] block subsystem related crash with latest -git

Jens Axboe
2007-10-17T18:02:34Z

On Wed, Oct 17 2007, Linus Torvalds wrote:
>
>
> On Wed, 17 Oct 2007, Jens Axboe wrote:
> >
> > OK, it is fine, as long as the sglist is cleared initially. And I don't
> > think there's anyway around that, clearly I didn't think long enough
> > before including the memset() removal from Tomo.
>
> Ok, I think that one-liner fixes the real bug.
>
> But I think the rest of your changes are simply bad.
>
> The fix to block/ll_rw_block.c should likely be something like the
> appended instead:
>
> - remove the "memset()" you had added earlier. It's bogus. It cannot be
> the right thing. If the sg list wasn't initialized correctly much
> earlier, trying to initialize it late is pointless - it contains crap.

It's required to clear output members (like dma_len and so on), since
some of the IOMU code really wants that initialized.

> - the old code was fine, but let's initialize "sg" to NULL to make it
> clear that the initial value of sg is pointless, and only "next_sg"
> matters (since sg had better be assigned from that).

If you prefer the old next_sg approach to my alternative, that is fine
with me. But we do need the memset().

--
Jens Axboe