FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 05-04-2010, 03:37 AM
Mike Anderson
 
Default blk: In elv_abort_queue skip requests with REQ_DONTPREP set

Having REQ_DONTPREP set on a request can indicated that resources have been
allocated for this request. In elv_abort_queue skip requests with
REQ_DONTPREP set to avoid leaking resources.

Signed-off-by: Mike Anderson <andmike@linux.vnet.ibm.com>
Cc: Jens Axobe <jens.axboe@oracle.com>
---
block/elevator.c | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/block/elevator.c b/block/elevator.c
index df75676..ac98008 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -807,10 +807,18 @@ int elv_may_queue(struct request_queue *q, int rw)

void elv_abort_queue(struct request_queue *q)
{
- struct request *rq;
+ struct request *rq, *tmp;
+ LIST_HEAD(list);

- while (!list_empty(&q->queue_head)) {
- rq = list_entry_rq(q->queue_head.next);
+ /*
+ * Splice entries to local list, in case the list contains some
+ * requests marked REQ_DONTPREP.
+ */
+ list_splice_init(&q->queue_head, &list);
+
+ list_for_each_entry_safe(rq, tmp, &list, queuelist) {
+ if (rq->cmd_flags & REQ_DONTPREP)
+ continue;
rq->cmd_flags |= REQ_QUIET;
trace_block_rq_abort(q, rq);
/*
@@ -820,6 +828,13 @@ void elv_abort_queue(struct request_queue *q)
blk_start_request(rq);
__blk_end_request_all(rq, -EIO);
}
+
+ /*
+ * In case requests with REQ_DONTPREP where skipped splice the
+ * local list back.
+ */
+ list_splice(&list, &q->queue_head);
+
}
EXPORT_SYMBOL(elv_abort_queue);

--
1.6.6.1

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 06:15 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org