Skip to content

Commit 73b4fca

Browse files
josephhzakpm00
authored andcommitted
ocfs2: cleanup return value and mlog in ocfs2_global_read_info()
Return 0 instead of sizeof(ocfs2_global_disk_dqinfo) that .quota_read returns in normal case. Also cleanup mlog to make code more readable. Link: https://lkml.kernel.org/r/20240904071004.2067695-2-joseph.qi@linux.alibaba.com Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com> Reviewed-by: Heming Zhao <heming.zhao@suse.com> Cc: Mark Fasheh <mark@fasheh.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Junxiao Bi <junxiao.bi@oracle.com> Cc: Changwei Ge <gechangwei@live.cn> Cc: Gang He <ghe@suse.com> Cc: Jun Piao <piaojun@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent fd127b1 commit 73b4fca

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

fs/ocfs2/quota_global.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,12 +371,16 @@ int ocfs2_global_read_info(struct super_block *sb, int type)
371371

372372
status = ocfs2_extent_map_get_blocks(oinfo->dqi_gqinode, 0, &oinfo->dqi_giblk,
373373
&pcount, NULL);
374-
if (status < 0)
374+
if (status < 0) {
375+
mlog_errno(status);
375376
goto out_unlock;
377+
}
376378

377379
status = ocfs2_qinfo_lock(oinfo, 0);
378-
if (status < 0)
380+
if (status < 0) {
381+
mlog_errno(status);
379382
goto out_unlock;
383+
}
380384
status = sb->s_op->quota_read(sb, type, (char *)&dinfo,
381385
sizeof(struct ocfs2_global_disk_dqinfo),
382386
OCFS2_GLOBAL_INFO_OFF);
@@ -404,12 +408,11 @@ int ocfs2_global_read_info(struct super_block *sb, int type)
404408
schedule_delayed_work(&oinfo->dqi_sync_work,
405409
msecs_to_jiffies(oinfo->dqi_syncms));
406410

407-
out_err:
408-
return status;
411+
return 0;
409412
out_unlock:
410413
ocfs2_unlock_global_qf(oinfo, 0);
411-
mlog_errno(status);
412-
goto out_err;
414+
out_err:
415+
return status;
413416
}
414417

415418
/* Write information to global quota file. Expects exclusive lock on quota

0 commit comments

Comments
 (0)