From c51bc66e4db9157937bea2101ae694eeb28522f2 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 21 Sep 2006 20:37:22 +0200 Subject: [PATCH] --- yaml --- r: 37592 b: refs/heads/master c: 059af497c23492cb1ddcbba11c09dad385960bc0 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/block/ll_rw_blk.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 7d8efe135151..5e840f6a97aa 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0fe23479577124bd2687e6783e39fa0fa4c28005 +refs/heads/master: 059af497c23492cb1ddcbba11c09dad385960bc0 diff --git a/trunk/block/ll_rw_blk.c b/trunk/block/ll_rw_blk.c index f757ed413214..83425fb3c8db 100644 --- a/trunk/block/ll_rw_blk.c +++ b/trunk/block/ll_rw_blk.c @@ -1171,11 +1171,16 @@ int blk_queue_start_tag(request_queue_t *q, struct request *rq) BUG(); } - tag = find_first_zero_bit(bqt->tag_map, bqt->max_depth); - if (tag >= bqt->max_depth) - return 1; + /* + * Protect against shared tag maps, as we may not have exclusive + * access to the tag map. + */ + do { + tag = find_first_zero_bit(bqt->tag_map, bqt->max_depth); + if (tag >= bqt->max_depth) + return 1; - __set_bit(tag, bqt->tag_map); + } while (test_and_set_bit(tag, bqt->tag_map)); rq->cmd_flags |= REQ_QUEUED; rq->tag = tag;