[merged] drivers-block-brdc-fix-brd_lookup_page-race.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Subject: [merged] drivers-block-brdc-fix-brd_lookup_page-race.patch removed from -mm tree
To: behlendorf1@xxxxxxxx,axboe@xxxxxxxxx,cw@xxxxxxxx,stable@xxxxxxxxxxxxxxx,mm-commits@xxxxxxxxxxxxxxx
From: akpm@xxxxxxxxxxxxxxxxxxxx
Date: Tue, 28 May 2013 12:37:11 -0700


The patch titled
     Subject: drivers/block/brd.c: fix brd_lookup_page() race
has been removed from the -mm tree.  Its filename was
     drivers-block-brdc-fix-brd_lookup_page-race.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Brian Behlendorf <behlendorf1@xxxxxxxx>
Subject: drivers/block/brd.c: fix brd_lookup_page() race

The index on the page must be set before it is inserted in the radix tree.
Otherwise there is a small race which can occur during lookup where the
page can be found with the incorrect index.  This will trigger the
BUG_ON() in brd_lookup_page().

Signed-off-by: Brian Behlendorf <behlendorf1@xxxxxxxx>
Reported-by: Chris Wedgwood <cw@xxxxxxxx>
Cc: Jens Axboe <axboe@xxxxxxxxx>
Cc: <stable@xxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/block/brd.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN drivers/block/brd.c~drivers-block-brdc-fix-brd_lookup_page-race drivers/block/brd.c
--- a/drivers/block/brd.c~drivers-block-brdc-fix-brd_lookup_page-race
+++ a/drivers/block/brd.c
@@ -117,13 +117,13 @@ static struct page *brd_insert_page(stru
 
 	spin_lock(&brd->brd_lock);
 	idx = sector >> PAGE_SECTORS_SHIFT;
+	page->index = idx;
 	if (radix_tree_insert(&brd->brd_pages, idx, page)) {
 		__free_page(page);
 		page = radix_tree_lookup(&brd->brd_pages, idx);
 		BUG_ON(!page);
 		BUG_ON(page->index != idx);
-	} else
-		page->index = idx;
+	}
 	spin_unlock(&brd->brd_lock);
 
 	radix_tree_preload_end();
_

Patches currently in -mm which might be from behlendorf1@xxxxxxxx are


--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]