> Index: linux-2.6/drivers/block/brd.c > =================================================================== > --- linux-2.6.orig/drivers/block/brd.c > +++ linux-2.6/drivers/block/brd.c > @@ -150,23 +150,27 @@ static void copy_to_brd(struct brd_devic > size_t copy; > > copy = min_t(size_t, n, PAGE_SIZE - offset); > + rcu_read_lock(); > page = brd_lookup_page(brd, sector); xa_load() inside brd_lookup_page() also calls rcu read lock. Instead of nesting rcu locks, could we modify the brd_lookup_page to use: diff --git a/drivers/block/brd.c b/drivers/block/brd.c index 970bd6ff38c4..acc37bfdd181 100644 --- a/drivers/block/brd.c +++ b/drivers/block/brd.c @@ -55,7 +55,9 @@ static struct page *brd_lookup_page(struct brd_device *brd, sector_t sector) struct page *page; idx = sector >> PAGE_SECTORS_SHIFT; /* sector to page index */ - page = xa_load(&brd->brd_pages, idx); + + XA_STATE(xas, &brd->brd_pages, idx); + page = xas_load(&xas); BUG_ON(page && page->index != idx); > BUG_ON(!page); > > dst = kmap_atomic(page); > memcpy(dst + offset, src, copy); > kunmap_atomic(dst);