]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: do not hold the write_lock on the extent tree while logging
authorJosef Bacik <jbacik@fusionio.com>
Fri, 14 Sep 2012 16:59:20 +0000 (12:59 -0400)
committerChris Mason <chris.mason@fusionio.com>
Thu, 4 Oct 2012 13:39:58 +0000 (09:39 -0400)
commit493775c424ff76124e6c063666d40a1b36a358aa
treee3be38a3bc4fc628aacc35a361446da8694c1301
parentf8de5969187a4e4de1206fcc21d6c37940ecc88b
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>
fs/btrfs/extent_map.c
fs/btrfs/extent_map.h
fs/btrfs/tree-log.c