From patchwork Fri Feb 27 23:53:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daeseok Youn X-Patchwork-Id: 5904221 Return-Path: X-Original-To: patchwork-ocfs2-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DA5A2BF440 for ; Fri, 27 Feb 2015 23:56:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2635720306 for ; Fri, 27 Feb 2015 23:56:28 +0000 (UTC) Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BCE96202A1 for ; Fri, 27 Feb 2015 23:56:26 +0000 (UTC) Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t1RNuFaQ006481 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 27 Feb 2015 23:56:16 GMT Received: from oss.oracle.com (oss-old-reserved.oracle.com [137.254.22.2]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t1RNuEqR000162 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 Feb 2015 23:56:15 GMT Received: from localhost ([127.0.0.1] helo=oss-external-new.us.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1YRUlS-0003ng-QY; Fri, 27 Feb 2015 15:56:14 -0800 Received: from acsinet21.oracle.com ([141.146.126.237]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1YRUlR-0003nF-1M for ocfs2-devel@oss.oracle.com; Fri, 27 Feb 2015 15:56:13 -0800 Received: from userp1030.oracle.com (userp1030.oracle.com [156.151.31.80]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t1RNuCPx000099 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 27 Feb 2015 23:56:12 GMT Received: from userp2030.oracle.com (userp2030.oracle.com [156.151.31.89]) by userp1030.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t1RNuBMa026804 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 27 Feb 2015 23:56:12 GMT Authentication-Results: userp1030.oracle.com; dkim=pass reason="2048-bit key" header.d=gmail.com header.i=@gmail.com header.b=JjamC/AQ Received: from pps.filterd (userp2030.oracle.com [127.0.0.1]) by userp2030.oracle.com (8.14.7/8.14.7) with SMTP id t1RNttxt029058 for ; Fri, 27 Feb 2015 23:56:11 GMT Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com [209.85.192.178]) by userp2030.oracle.com with ESMTP id 1stys4b16t-1 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 27 Feb 2015 23:56:11 +0000 Received: by pdbfp1 with SMTP id fp1so24532224pdb.5 for ; Fri, 27 Feb 2015 15:56:11 -0800 (PST) X-Received: by 10.68.69.108 with SMTP id d12mr27504630pbu.137.1425081370949; Fri, 27 Feb 2015 15:56:10 -0800 (PST) Received: from devel.8.8.4.4 ([220.149.250.136]) by mx.google.com with ESMTPSA id x1sm5012797pdl.51.2015.02.27.15.56.08 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 27 Feb 2015 15:56:10 -0800 (PST) Date: Sat, 28 Feb 2015 08:53:29 +0900 From: Daeseok Youn To: mfasheh@suse.com, akpm@linux-foundation.org Message-ID: <20150227235329.GA12979@devel.8.8.4.4> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) X-ServerName: mail-pd0-f178.google.com X-Proofpoint-Virus-Version: vendor=nai engine=5700 definitions=7725 signatures=670628 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=2 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1502270253 Cc: ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org Subject: [Ocfs2-devel] [PATCH 4/4 RESEND] ocfs2: remove goto statement in ocfs2_check_dir_for_entry() X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,RCVD_IN_DNSWL_MED,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Daeseok Youn Reviewed-by: Joseph Qi --- RESEND: this patch is rebased by 1/4. fs/ocfs2/dir.c | 13 +++++-------- 1 files changed, 5 insertions(+), 8 deletions(-) diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index c63f2b6..b3ab2a6 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -2043,22 +2043,19 @@ int ocfs2_check_dir_for_entry(struct inode *dir, const char *name, int namelen) { - int ret; + int ret = 0; struct ocfs2_dir_lookup_result lookup = { NULL, }; trace_ocfs2_check_dir_for_entry( (unsigned long long)OCFS2_I(dir)->ip_blkno, namelen, name); - ret = -EEXIST; - if (ocfs2_find_entry(name, namelen, dir, &lookup) == 0) - goto bail; + if (ocfs2_find_entry(name, namelen, dir, &lookup) == 0) { + ret = -EEXIST; + mlog_errno(ret); + } - ret = 0; -bail: ocfs2_free_dir_lookup_result(&lookup); - if (ret) - mlog_errno(ret); return ret; }