lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20071212.153815.39152138.k-ueda@ct.jp.nec.com>
Date:	Wed, 12 Dec 2007 15:38:15 -0500 (EST)
From:	Kiyoshi Ueda <k-ueda@...jp.nec.com>
To:	zaitcev@...hat.com
Cc:	jens.axboe@...cle.com, linux-kernel@...r.kernel.org,
	linux-scsi@...r.kernel.org, linux-ide@...r.kernel.org,
	dm-devel@...hat.com, j-nomura@...jp.nec.com, k-ueda@...jp.nec.com
Subject: Re: [PATCH 12/30] blk_end_request: changing ub (take 4)

Hi Pete,

On Tue, 11 Dec 2007 15:48:03 -0800, Pete Zaitcev <zaitcev@...hat.com> wrote:
> >  	if (scsi_status == 0) {
> > -		uptodate = 1;
> > +		error = 0;
> >  	} else {
> > -		uptodate = 0;
> > +		error = -EIO;
> >  		rq->errors = scsi_status;
> >  	}
> > -	end_that_request_first(rq, uptodate, rq->hard_nr_sectors);
> > -	end_that_request_last(rq, uptodate);
> > +	if (__blk_end_request(rq, error, blk_rq_bytes(rq)))
> > +		BUG();
> 
> Acked-by: Pete Zaitcev <zaitcev@...hat.com>
> 
> I follow the discussion, actually, and wanted to ask someone to look
> closer if it's appropriate to use __blk_end_request() here.
> My understanding was, blk_end_request() is the same thing, only
> takes the queue lock. But then, should I refactor ub so that it
> calls __blk_end_request if request function ends with an error
> and blk_end_request if the end-of-IO even is processed? If not,
> and the above is sufficient, why have blk_end_request at all?

The difference between blk_end_request() and __blk_end_request() is
whether the queue lock is held or not when end_that_request_last()
is called.
It's not relevant to the status of the request (error or not).

I'm using __blk_end_request() here and I think it's sufficient, because:
  o end_that_request_last() must be called with the queue lock held
  o ub_end_rq() calls end_that_request_last() without taking
    the queue lock in itself.
    So the queue lock must have been taken outside ub_end_rq().

But, if ub is calling end_that_request_last() without the queue lock,
it is a bug in the original code and we should use blk_end_request()
to fix that.

Does that answer satisfy you?

Thanks,
Kiyoshi Ueda
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ