summaryrefslogtreecommitdiff
path: root/fs/btrfs/extent_map.h
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2012-09-14 12:59:20 -0400
committerChris Mason <chris.mason@fusionio.com>2012-10-04 09:39:58 -0400
commitff44c6e36dc9dcc02652a1105b120bdf08cea9f7 (patch)
treee3be38a3bc4fc628aacc35a361446da8694c1301 /fs/btrfs/extent_map.h
parent98114659e0d467e2c0ee6f24f2429329328fc312 (diff)
Btrfs: do not hold the write_lock on the extent tree while logging
Dave Sterba pointed out a sleeping while atomic bug while doing fsync. This is because I'm an idiot and didn't realize that rwlock's were spin locks, so we've been holding this thing while doing allocations and such which is not good. This patch fixes this by dropping the write lock before we do anything heavy and re-acquire it when it is done. We also need to take a ref on the em's in case their corresponding pages are evicted and mark them as being logged so that releasepage does not remove them and doesn't remove them from our local list. Thanks, Reported-by: Dave Sterba <dave@jikos.cz> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/extent_map.h')
-rw-r--r--fs/btrfs/extent_map.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/extent_map.h b/fs/btrfs/extent_map.h
index 8e6294b51357..679225555f7b 100644
--- a/fs/btrfs/extent_map.h
+++ b/fs/btrfs/extent_map.h
@@ -13,6 +13,7 @@
#define EXTENT_FLAG_COMPRESSED 1
#define EXTENT_FLAG_VACANCY 2 /* no file extent item found */
#define EXTENT_FLAG_PREALLOC 3 /* pre-allocated extent */
+#define EXTENT_FLAG_LOGGING 4 /* Logging this extent */
struct extent_map {
struct rb_node rb_node;