Re: [PATCH 1/4 V2] ocfs2: use retval instead of status for checking error

From: Andrew Morton
Date: Thu Mar 19 2015 - 18:23:12 EST


On Sat, 28 Feb 2015 08:48:40 +0900 Daeseok Youn <daeseok.youn@xxxxxxxxx> wrote:

> The use of 'status' in __ocfs2_add_entry() can return wrong
> status when some functions are failed.
>
> If ocfs2_journal_access_db() in __ocfs2_add_entry() is failed,
> that status is saved to 'status' but return variable is 'retval'
> which is saved 'success' status. In case of this, __ocfs2_add_entry()
> is failed but can be returned as 'success'.
>
> So replace 'status' with 'retval'.
>
> - mlog_errno(status);
> + if (retval) {
> + mlog_errno(retval);
> goto bail;

and

bail:
if (retval)
mlog_errno(retval);

return retval;
}

so we'll clearly log the same error twice.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/