Btrfs: make sure there are not any read requests before stopping workers
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>
Wed, 9 Apr 2014 11:23:22 +0000 (19:23 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Jul 2014 03:09:46 +0000 (20:09 -0700)
commit791a1cc32d1ba64024db044e738661b5e119d5fa
treec3bb7513ab743fa2f40a3967e6558961ce17f912
parent87d7177149733a17cdcf6424b329c8f9be6d4b7c
Btrfs: make sure there are not any read requests before stopping workers

commit de348ee022175401e77d7662b7ca6e231a94e3fd upstream.

In close_ctree(), after we have stopped all workers,there maybe still
some read requests(for example readahead) to submit and this *maybe* trigger
an oops that user reported before:

kernel BUG at fs/btrfs/async-thread.c:619!

By hacking codes, i can reproduce this problem with one cpu available.
We fix this potential problem by invalidating all btree inode pages before
stopping all workers.

Thanks to Miao for pointing out this problem.

Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/disk-io.c