]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fs/fat/file.c: issue flush after the writeback of FAT
authorHou Tao <houtao1@huawei.com>
Tue, 14 May 2019 22:44:32 +0000 (15:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Jun 2019 06:18:17 +0000 (08:18 +0200)
commit8b9241b052a23e5552185a91c8437dc3b81527f7
tree6bb65fd4a1a2362e17e03352a0b2cd4fa04ba305
parent33790f2eda7393d422927078597a33475792c82c
fs/fat/file.c: issue flush after the writeback of FAT

[ Upstream commit bd8309de0d60838eef6fb575b0c4c7e95841cf73 ]

fsync() needs to make sure the data & meta-data of file are persistent
after the return of fsync(), even when a power-failure occurs later.  In
the case of fat-fs, the FAT belongs to the meta-data of file, so we need
to issue a flush after the writeback of FAT instead before.

Also bail out early when any stage of fsync fails.

Link: http://lkml.kernel.org/r/20190409030158.136316-1-houtao1@huawei.com
Signed-off-by: Hou Tao <houtao1@huawei.com>
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/fat/file.c