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]
Date:	Tue, 29 Jan 2013 12:34:24 +0100
From:	Hannes Reinecke <hare@...e.de>
To:	Heiko Carstens <heiko.carstens@...ibm.com>
Cc:	Martin Schwidefsky <schwidefsky@...ibm.com>,
	linux-kernel@...r.kernel.org, Stefan Weinhuber <wein@...ibm.com>
Subject: Re: [PATCH 4/9] dasd: Implement block timeout handling

On 01/29/2013 12:32 PM, Heiko Carstens wrote:
> On Tue, Jan 29, 2013 at 08:11:56AM +0100, Hannes Reinecke wrote:
>> This patch implements generic block layer timeout handling
>> callbacks for DASDs. When the timeout expires the respective
>> cqr is aborted.
>>
>> With this timeout handler time-critical request abort
>> is guaranteed as the abort does not depend on the internal
>> state of the various DASD driver queues.
>>
>> Signed-off-by: Hannes Reinecke <hare@...e.de>
>> Acked-by: Stefan Weinhuber <wein@...ibm.com>
>
> [...]
>
>> +enum blk_eh_timer_return dasd_times_out(struct request *req)
>> +{
>> +	struct dasd_ccw_req *cqr = req->completion_data;
>> +	struct dasd_block *block = req->q->queuedata;
>> +	struct dasd_device *device;
>> +	int rc = 0;
>> +
>> +	if (!cqr)
>> +		return BLK_EH_NOT_HANDLED;
>> +
>> +	device = cqr->startdev ? cqr->startdev : block->base;
>> +	DBF_DEV_EVENT(DBF_WARNING, device,
>> +		      " dasd_times_out cqr %p status %x",
>> +		      cqr, cqr->status);
>> +
>> +	spin_lock(&block->queue_lock);
>> +	spin_lock(get_ccwdev_lock(device->cdev));
>
>          ^^^
>
>> +	cqr->retries = -1;
>> +	cqr->intrc = -ETIMEDOUT;
>> +	if (cqr->status >= DASD_CQR_QUEUED) {
>> +		spin_unlock(get_ccwdev_lock(device->cdev));
>> +		rc = dasd_cancel_req(cqr);
>> +	} else if (cqr->status == DASD_CQR_FILLED ||
>> +		   cqr->status == DASD_CQR_NEED_ERP) {
>> +		cqr->status = DASD_CQR_TERMINATED;
>> +		spin_unlock(get_ccwdev_lock(device->cdev));
>> +	} else if (cqr->status == DASD_CQR_IN_ERP) {
>> +		struct dasd_ccw_req *searchcqr, *nextcqr, *tmpcqr;
>> +
>> +		list_for_each_entry_safe(searchcqr, nextcqr,
>> +					 &block->ccw_queue, blocklist) {
>> +			tmpcqr = searchcqr;
>> +			while (tmpcqr->refers)
>> +				tmpcqr = tmpcqr->refers;
>> +			if (tmpcqr != cqr)
>> +				continue;
>> +			/* searchcqr is an ERP request for cqr */
>> +			searchcqr->retries = -1;
>> +			searchcqr->intrc = -ETIMEDOUT;
>> +			if (searchcqr->status >= DASD_CQR_QUEUED) {
>> +				spin_lock(get_ccwdev_lock(device->cdev));
>
> 				^^^
> This looks like a potential dead lock.
>
Right.

Will be resending the patch.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@...e.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
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