mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
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 <frank.li@vivo.com> Signed-off-by: Jan Kara <jack@suse.cz> Message-Id: <20230227120216.31306-1-frank.li@vivo.com>
This commit is contained in:
parent
dced733d7f
commit
f8107c996f
@ -206,7 +206,7 @@ static int v1_write_file_info(struct super_block *sb, int type)
|
||||
sizeof(struct v1_disk_dqblk), v1_dqoff(0));
|
||||
if (ret == sizeof(struct v1_disk_dqblk))
|
||||
ret = 0;
|
||||
else if (ret > 0)
|
||||
else if (ret >= 0)
|
||||
ret = -EIO;
|
||||
out:
|
||||
up_write(&dqopt->dqio_sem);
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user