From f8107c996f5419a5b964b9796d736c7b81f099a0 Mon Sep 17 00:00:00 2001 From: Yangtao Li Date: Mon, 27 Feb 2023 20:02:15 +0800 Subject: quota: fixup *_write_file_info() to return proper error code For v1_write_file_info function, when quota_write() returns 0, it should be considered an EIO error. And for v2_write_file_info(), fix to proper error return code instead of raw number. Signed-off-by: Yangtao Li Signed-off-by: Jan Kara Message-Id: <20230227120216.31306-1-frank.li@vivo.com> --- fs/quota/quota_v2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/quota/quota_v2.c') diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c index b1467f3921c2..ae99e7b88205 100644 --- a/fs/quota/quota_v2.c +++ b/fs/quota/quota_v2.c @@ -212,7 +212,7 @@ static int v2_write_file_info(struct super_block *sb, int type) up_write(&dqopt->dqio_sem); if (size != sizeof(struct v2_disk_dqinfo)) { quota_error(sb, "Can't write info structure"); - return -1; + return size < 0 ? size : -EIO; } return 0; } -- cgit v1.2.3