From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751303AbbCTBRl (ORCPT ); Thu, 19 Mar 2015 21:17:41 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:22618 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751032AbbCTBRj (ORCPT ); Thu, 19 Mar 2015 21:17:39 -0400 Message-ID: <550B7518.7000701@huawei.com> Date: Fri, 20 Mar 2015 09:17:12 +0800 From: Joseph Qi User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Andrew Morton CC: Daeseok Youn , , , , Subject: Re: [Ocfs2-devel] [PATCH 1/4 V2] ocfs2: use retval instead of status for checking error References: <20150227234840.GA12922@devel.8.8.4.4> <20150319152305.d4ff5c83744591ff9340db92@linux-foundation.org> In-Reply-To: <20150319152305.d4ff5c83744591ff9340db92@linux-foundation.org> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.24.125] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrew, On 2015/3/20 6:23, Andrew Morton wrote: > On Sat, 28 Feb 2015 08:48:40 +0900 Daeseok Youn 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 > >