]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ocfs2: cleanup return value and mlog in ocfs2_global_read_info()
authorJoseph Qi <joseph.qi@linux.alibaba.com>
Wed, 4 Sep 2024 07:10:04 +0000 (15:10 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 9 Sep 2024 23:47:43 +0000 (16:47 -0700)
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>
fs/ocfs2/quota_global.c

index 0575c2d060ebcfbec62d8e6003113e3dfc4a9fa8..2b0daced98ebb487e831d99ae1d7e19bd45e9cb1 100644 (file)
@@ -371,12 +371,16 @@ int ocfs2_global_read_info(struct super_block *sb, int type)
 
        status = ocfs2_extent_map_get_blocks(oinfo->dqi_gqinode, 0, &oinfo->dqi_giblk,
                                             &pcount, NULL);
-       if (status < 0)
+       if (status < 0) {
+               mlog_errno(status);
                goto out_unlock;
+       }
 
        status = ocfs2_qinfo_lock(oinfo, 0);
-       if (status < 0)
+       if (status < 0) {
+               mlog_errno(status);
                goto out_unlock;
+       }
        status = sb->s_op->quota_read(sb, type, (char *)&dinfo,
                                      sizeof(struct ocfs2_global_disk_dqinfo),
                                      OCFS2_GLOBAL_INFO_OFF);
@@ -404,12 +408,11 @@ int ocfs2_global_read_info(struct super_block *sb, int type)
        schedule_delayed_work(&oinfo->dqi_sync_work,
                              msecs_to_jiffies(oinfo->dqi_syncms));
 
-out_err:
-       return status;
+       return 0;
 out_unlock:
        ocfs2_unlock_global_qf(oinfo, 0);
-       mlog_errno(status);
-       goto out_err;
+out_err:
+       return status;
 }
 
 /* Write information to global quota file. Expects exclusive lock on quota