lkml.org 
[lkml]   [2015]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/4 V2] ocfs2: use retval instead of status for checking error
On Sat, 28 Feb 2015 08:48:40 +0900 Daeseok Youn <daeseok.youn@gmail.com> 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.


\
 
 \ /
  Last update: 2015-03-20 00:01    [W:0.580 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site