OSDN Git Service

fuse: truncate pending writes on O_TRUNC
authorMiklos Szeredi <mszeredi@redhat.com>
Wed, 23 Oct 2019 12:26:37 +0000 (14:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Nov 2019 11:09:18 +0000 (12:09 +0100)
commit6cdc9e836cb3603634e6839602fe00c5bfc2ebf0
tree16124863db233eb74fc8cb04bce989a8831f680a
parenteb4b7a625cfe7e87343b1458329c23c53d4bde59
fuse: truncate pending writes on O_TRUNC

commit e4648309b85a78f8c787457832269a8712a8673e upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/fuse/file.c