Btrfs: fix possible empty list access when flushing the delalloc inodes
authorMiao Xie <miaox@cn.fujitsu.com>
Thu, 6 Mar 2014 05:55:03 +0000 (13:55 +0800)
committerJosef Bacik <jbacik@fb.com>
Mon, 10 Mar 2014 19:17:29 +0000 (15:17 -0400)
commit573bfb72f7608eb7097d2dd036a714a6ab20cffe
tree5434c2e82299cf22af4470fef31d3890d209a0b9
parent31f3d255c677073f83daa1e0671bbf2157bf8edc
Btrfs: fix possible empty list access when flushing the delalloc inodes

We didn't have a lock to protect the access to the delalloc inodes list, that is
we might access a empty delalloc inodes list if someone start flushing delalloc
inodes because the delalloc inodes were moved into a other list temporarily.
Fix it by wrapping the access with a lock.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/inode.c