From: Vasily Averin vvs@virtuozzo.com
mainline inclusion from mainline-v5.8-rc6 commit 7779b047a57f6824a43d0e1f70de2741b7426b9d category: bugfix bugzilla: 39163 CVE: NA
-------------------------------------------------
fuse_writepages() ignores some errors taken from fuse_writepages_fill() I believe it is a bug: if .writepages is called with WB_SYNC_ALL it should either guarantee that all data was successfully saved or return error.
Fixes: 26d614df1da9 ("fuse: Implement writepages callback") Signed-off-by: Vasily Averin vvs@virtuozzo.com Signed-off-by: Miklos Szeredi mszeredi@redhat.com Signed-off-by: Yu Kuai yukuai3@huawei.com Reviewed-by: Zhang Yi yi.zhang@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- fs/fuse/file.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index c1af038920dc5..9c11897845728 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -1936,10 +1936,8 @@ static int fuse_writepages(struct address_space *mapping,
err = write_cache_pages(mapping, wbc, fuse_writepages_fill, &data); if (data.req) { - /* Ignore errors if we can write at least one page */ BUG_ON(!data.req->num_pages); fuse_writepages_send(&data); - err = 0; } if (data.ff) fuse_file_put(data.ff, false, false);