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)
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

Simple merge
Simple merge
Simple merge