fuse: truncate pending writes on O_TRUNC
authorMiklos Szeredi <mszeredi@redhat.com>
Wed, 23 Oct 2019 12:26:37 +0000 (14:26 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Wed, 23 Oct 2019 12:26:37 +0000 (14:26 +0200)
commite4648309b85a78f8c787457832269a8712a8673e
tree59b43e109af068370d36fd35a6f7d88be00c4e82
parentb24e7598db62386a95a3c8b9c75630c5d56fe077
fuse: truncate pending writes on O_TRUNC

Make sure cached writes are not reordered around open(..., O_TRUNC), with
the obvious wrong results.

Fixes: 4d99ff8f12eb ("fuse: Turn writeback cache on")
Cc: <stable@vger.kernel.org> # v3.15+
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/file.c