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:	Fri, 11 Jan 2008 13:14:21 +0100
From:	Jens Axboe <jens.axboe@...cle.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	oakad@...mail.com.au, linux-kernel@...r.kernel.org,
	Alex Dubov <oakad@...oo.com>
Subject: Re: [PATCH] [MEMSTICK] Initial commit for Sony MemoryStick support

On Thu, Jan 10 2008, Andrew Morton wrote:
> > +static void mspro_block_request(struct request_queue *q)
> > +{
> > +	struct memstick_dev *card = q->queuedata;
> > +	struct mspro_block_data *msb = memstick_get_drvdata(card);
> > +	struct request *req = NULL;
> > +
> > +	if (!msb->q_thread) {
> > +		for (req = elv_next_request(q); req;
> > +		     req = elv_next_request(q)) {
> > +			while (end_that_request_chunk(req, -ENODEV,
> > +						      req->current_nr_sectors
> > +						      << 9)) {}
> > +			end_that_request_last(req, -ENODEV);
> > +		}
> > +	} else {
> > +		msb->has_request = 1;
> > +		wake_up_all(&msb->q_wait);
> > +	}
> > +}
> 
> Suggest that you cc Jens on this, see if he can check it all over.

It's suboptimal and doesn't work for non-fs request. Just use
end_queued_request() instead:

if (msb->q_thread) {
        msb->has_request = 1;
        wake_up(&msb->q_wait);
} else {
        while ((req = elv_next_request(q)) != NULL)
                end_queued_request(req, -ENODEV);
}

which is simpler and gets all cases correct. Reordering for normal case
as well.

-- 
Jens Axboe

--
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