Re: [patch] scsi: revert "[SCSI] Get rid of scsi_cmnd->done"

James Bottomley
2008-01-02T20:12:42Z

On Wed, 2008-01-02 at 12:40 -0700, Matthew Wilcox wrote:
> On Wed, Jan 02, 2008 at 11:19:14AM -0800, Linus Torvalds wrote:
> > It's totally immaterial if we have one reporter or many. The fact is, that
> > thing has been outstanding for almost two months now. The root cause is
> > almost certainly known (and Matthew is apparently even aware of it), but
>
> I really don't think the root cause is known.
>
> > By now, it needs to either have a patch, or to be reverted. It's too late
> > to make excuses.
>
> I think reverting it is the correct thing to do.

OK ... I'll revert it. However, I still think it's the wrong course of
action, because as far as my analysis goes, this code is functionally
equivalent to what went before with the exception that we now rely on
the request->cmd_type information in the post processing (previously we
just relied on the cmnd->done pointer).

As far as I understand what's going on, the reporter is misusing the
interface. He sets up a packet mapping and then accesses the underlying
device, which is wrong (you're supposed to access now via the packet
device). The one thing the packet mapping does is to alter the
blocksize, which could lead to the errors reported (because the
underlying fs block size and the actual block size differ) ... however,
I think it should do this all the time, so what I'm unable to explain is
why it doesn't write past the end of the device with this commit
reverted.

But all of the above is the hallmark of an existing bug that this commit
exposes ... revert it, and we'll cover the underlying problem up again.

James