All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joseph Qi <joseph.qi@huawei.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Daeseok Youn <daeseok.youn@gmail.com>,
	richard.weinberger@gmail.com, mfasheh@suse.com,
	ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org
Subject: [Ocfs2-devel] [PATCH 1/4 V2] ocfs2: use retval instead of status for checking error
Date: Fri, 20 Mar 2015 09:17:12 +0800	[thread overview]
Message-ID: <550B7518.7000701@huawei.com> (raw)
In-Reply-To: <20150319152305.d4ff5c83744591ff9340db92@linux-foundation.org>

Hi Andrew,

On 2015/3/20 6:23, Andrew Morton wrote:
> 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.
> 
IMO, if we only depends on the bail error log, we still don't know where
the error occurs.
So if we want to do the cleanup, the bail error log should be cleaned.

> _______________________________________________
> Ocfs2-devel mailing list
> Ocfs2-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/ocfs2-devel
> 
> 

WARNING: multiple messages have this Message-ID (diff)
From: Joseph Qi <joseph.qi@huawei.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Daeseok Youn <daeseok.youn@gmail.com>,
	<richard.weinberger@gmail.com>, <mfasheh@suse.com>,
	<ocfs2-devel@oss.oracle.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [Ocfs2-devel] [PATCH 1/4 V2] ocfs2: use retval instead of status for checking error
Date: Fri, 20 Mar 2015 09:17:12 +0800	[thread overview]
Message-ID: <550B7518.7000701@huawei.com> (raw)
In-Reply-To: <20150319152305.d4ff5c83744591ff9340db92@linux-foundation.org>

Hi Andrew,

On 2015/3/20 6:23, Andrew Morton wrote:
> 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.
> 
IMO, if we only depends on the bail error log, we still don't know where
the error occurs.
So if we want to do the cleanup, the bail error log should be cleaned.

> _______________________________________________
> Ocfs2-devel mailing list
> Ocfs2-devel@oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/ocfs2-devel
> 
> 



  reply	other threads:[~2015-03-20  1:17 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-27 23:48 [Ocfs2-devel] [PATCH 1/4 V2] ocfs2: use retval instead of status for checking error Daeseok Youn
2015-02-27 23:48 ` Daeseok Youn
2015-03-02  9:04 ` [Ocfs2-devel] " Richard Weinberger
2015-03-02  9:04   ` Richard Weinberger
2015-03-03  1:38   ` [Ocfs2-devel] " DaeSeok Youn
2015-03-03  1:38     ` DaeSeok Youn
2015-03-05  9:36     ` [Ocfs2-devel] " DaeSeok Youn
2015-03-05  9:36       ` DaeSeok Youn
2015-03-13  3:59 ` [Ocfs2-devel] " DaeSeok Youn
2015-03-13  3:59   ` DaeSeok Youn
2015-03-13  8:15   ` [Ocfs2-devel] " Richard Weinberger
2015-03-13  8:15     ` Richard Weinberger
2015-03-13 11:14     ` [Ocfs2-devel] " DaeSeok Youn
2015-03-19  6:24 ` Joseph Qi
2015-03-19  6:24   ` Joseph Qi
2015-03-20  2:22   ` DaeSeok Youn
2015-03-20  2:22     ` DaeSeok Youn
2015-03-19 22:23 ` Andrew Morton
2015-03-19 22:23   ` Andrew Morton
2015-03-20  1:17   ` Joseph Qi [this message]
2015-03-20  1:17     ` [Ocfs2-devel] " Joseph Qi
2015-03-24  6:17     ` DaeSeok Youn
2015-03-24  6:17       ` DaeSeok Youn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=550B7518.7000701@huawei.com \
    --to=joseph.qi@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=daeseok.youn@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mfasheh@suse.com \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=richard.weinberger@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.