Patchwork [1/2] reiserfs: Fix possible recursive lock

login
register
mail settings
Submitter Frederic Weisbecker
Date Dec. 14, 2009, 10:53 a.m.
Message ID <1260788016-5468-1-git-send-regression-fweisbec@gmail.com>
Download mbox | patch
Permalink /patch/67256/
State New, archived
Headers show

Comments

Patch

diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c
index 6854957..65c8727 100644
--- a/fs/reiserfs/bitmap.c
+++ b/fs/reiserfs/bitmap.c
@@ -1277,7 +1277,10 @@  int reiserfs_init_bitmap_cache(struct super_block *sb)
 	struct reiserfs_bitmap_info *bitmap;
 	unsigned int bmap_nr = reiserfs_bmap_count(sb);
 
+	/* Avoid lock recursion in fault case */
+	reiserfs_write_unlock(sb);
 	bitmap = vmalloc(sizeof(*bitmap) * bmap_nr);
+	reiserfs_write_lock(sb);
 	if (bitmap == NULL)
 		return -ENOMEM;