From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751303AbbCSWXJ (ORCPT ); Thu, 19 Mar 2015 18:23:09 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58627 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750734AbbCSWXG (ORCPT ); Thu, 19 Mar 2015 18:23:06 -0400 Date: Thu, 19 Mar 2015 15:23:05 -0700 From: Andrew Morton To: Daeseok Youn Cc: mfasheh@suse.com, jlbec@evilplan.org, ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org, richard.weinberger@gmail.com Subject: Re: [PATCH 1/4 V2] ocfs2: use retval instead of status for checking error Message-Id: <20150319152305.d4ff5c83744591ff9340db92@linux-foundation.org> In-Reply-To: <20150227234840.GA12922@devel.8.8.4.4> References: <20150227234840.GA12922@devel.8.8.4.4> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Date: Thu, 19 Mar 2015 15:23:05 -0700 Subject: [Ocfs2-devel] [PATCH 1/4 V2] ocfs2: use retval instead of status for checking error In-Reply-To: <20150227234840.GA12922@devel.8.8.4.4> References: <20150227234840.GA12922@devel.8.8.4.4> Message-ID: <20150319152305.d4ff5c83744591ff9340db92@linux-foundation.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Daeseok Youn Cc: mfasheh@suse.com, jlbec@evilplan.org, ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org, richard.weinberger@gmail.com 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.