quota: make dquot_set_dqinfo return errors from ->write_info
PATCH 1/1 quota: make dquot_set_dqinfo return errors from ->write_info
dquot_set_dqinfo() ignores the return code from the ->write_info call, which means that quotacalls like Q_SETINFO never see the error. This doesn't seem right, so fix that.
Signed-off-by Yangtao Li <[email protected]>
--- fs/quota/dquot.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
fs/quota/dquot.c +1 -3
@@ -2819,7 +2819,6 @@ EXPORT_SYMBOL(dquot_get_state);int dquot_set_dqinfo (struct super_block *sb,int type,struct qc_info *ii) {struct mem_dqinfo *mi; -int err =0 ;if ((ii->i_fieldmask &QC_WARNS_MASK ) || (ii->i_fieldmask &QC_RT_SPC_TIMER ))
@@ -2846,8 +2845,7 @@ int dquot_set_dqinfo(struct super_block *sb, int type, struct qc_info *ii)spin_unlock (&dq_data_lock);mark_info_dirty (sb, type);/* Force write to disk */ - sb->dq_op->write_info (sb, type); -return err; +return sb->dq_op->write_info (sb, type); }EXPORT_SYMBOL (dquot_set_dqinfo);
Signature · 1 line
2.25.1
Quoted 5 lines · Yangtao Li
dquot_set_dqinfo()ignores the return code from the ->write_info call, which means that quotacalls likeQ_SETINFOnever see the error. This doesn't seem right, so fix that.Signed-off-by Yangtao Li <[email protected]>
Thanks for the fix. It looks good but if you have a look into implementations you'll notice that v2_write_file_info() returns 0 or -1, not the error code. So before doing this, you also need to fixup v2_write_file_info() to return proper error code. What v1_write_file_info() does looks like a good inspiration.
Honza
Quoted 29 lines
--- fs/quota/dquot.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)fs/quota/dquot.c +1
-3@@ -2819,7 +2819,6 @@ EXPORT_SYMBOL(dquot_get_state);int dquot_set_dqinfo (struct super_block *sb,int type,struct qc_info *ii) {struct mem_dqinfo *mi; -int err =0 ;if ((ii->i_fieldmask &QC_WARNS_MASK ) || (ii->i_fieldmask &QC_RT_SPC_TIMER ))@@ -2846,8 +2845,7 @@ int dquot_set_dqinfo(struct super_block *sb, int type, struct qc_info *ii)spin_unlock (&dq_data_lock);mark_info_dirty (sb, type);/* Force write to disk */ - sb->dq_op->write_info (sb, type); -return err; +return sb->dq_op->write_info (sb, type); }EXPORT_SYMBOL (dquot_set_dqinfo);Signature · 1 line
2.25.1
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR