[dm-devel] [PATCHES] convert dm-thin to use dm-bufio

Mikulas Patocka mpatocka at redhat.com
Mon Aug 22 19:59:05 UTC 2011


> > I've merged and pushed this to my git repo.
> 
> I checkouted the tree now (I tried all branches reported with git-branch 
> -a), but I couldn't see bufio in any of the branches.

It was my mistake --- I forgot to do git-fetch before git-checkout.

Here is a patch that uses down_read_trylock instead of down_read in 
dm_bm_read_try_lock.

Mikulas

---
 drivers/md/persistent-data/dm-block-manager.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Index: linux-3.0-fast/drivers/md/persistent-data/dm-block-manager.c
===================================================================
--- linux-3.0-fast.orig/drivers/md/persistent-data/dm-block-manager.c	2011-08-22 21:53:31.000000000 +0200
+++ linux-3.0-fast/drivers/md/persistent-data/dm-block-manager.c	2011-08-22 21:54:38.000000000 +0200
@@ -176,7 +176,10 @@ int dm_bm_read_try_lock(struct dm_block_
 		return -EWOULDBLOCK;
 
 	aux = dm_bufio_get_aux_data(*result);
-	down_read(&aux->lock);
+	if (unlikely(!down_read_trylock(&aux->lock))) {
+		dm_bufio_release(*result);
+		return -EWOULDBLOCK;
+	}
 	aux->write_locked = 0;
 
 	r = dm_bm_validate_buffer(bm, *result, aux, v);




More information about the dm-devel mailing list