Btrfs: fix filemap_flush call in btrfs_file_release
authorChris Mason <clm@fb.com>
Wed, 20 Aug 2014 14:15:33 +0000 (07:15 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Sep 2014 23:36:37 +0000 (16:36 -0700)
commita1bbac07b61162c67f5d814db0502b188d3eb30e
tree4b1856042bf6a24b2d65426d05f77c3e0300f0cf
parentddef1474c305ea0d1cb5a93398db014caf141d64
Btrfs: fix filemap_flush call in btrfs_file_release

commit f6dc45c7a93a011dff6eb9b2ffda59c390c7705a upstream.

We should only be flushing on close if the file was flagged as needing
it during truncate.  I broke this with my ordered data vs transaction
commit deadlock fix.

Thanks to Miao Xie for catching this.

Signed-off-by: Chris Mason <clm@fb.com>
Reported-by: Miao Xie <miaox@cn.fujitsu.com>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/file.c