Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp826535pxv; Thu, 1 Jul 2021 10:05:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyi4THCwdQd+cx24lk1S75Xe+kgp2NVxWdKuKDZ1TViyfs44nMwehRTYpIisjnq7irwmf8/ X-Received: by 2002:a92:7510:: with SMTP id q16mr266295ilc.291.1625159099934; Thu, 01 Jul 2021 10:04:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625159099; cv=none; d=google.com; s=arc-20160816; b=YKJeZe+sDrX80urxCkMIrzciVFQZLERIKUUMzy2iWDG2keY4yNpxriVXhmN/JROxO9 D6Y8AQfnxVj0VW2IYlyItIgdIuOWkUxEuLtwF+GaYRmr+G4qNmL2Or63UckcAs1VzQKg TGuO3TGWTj/O/vVhSewtaz4YTj+7cKH9+e/h0dnJlxe68JatAOgGIjWJ/iVIXwANiweD paeSA9I3ZHZqC13RSioXK4kPJmabe3ipCkf1oTkSUqiNiDlScrk5aMTSrb1xcvu07Xnn oWDaI/22hvg310ZjJ5CRLHIObaacQ1+E7FS9KdKUK+5UIxbS8txufvcdcaVpMVmC0aex AeuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=M0Yqw0xxOZEekYTg3q3CvD7YLfizNegvaHh2b9l5Vmk=; b=Jmn2iqwhcOMXKBvoYZ4bibX2VQYkUUo66SgKAZdblrs/CyPzkObCoCfAv9NoYxDHGk 6a6hc4JGJRrRvtXIf7edi4JIUHWHzWFOy8yNXyEisg8CPWHnlY9T5/FQvruQSF9EQLN0 jk6genIMHu4EtqpCqzzjdUgrCg0Rno64T20CuMidxaZnEfIQnA+jsfmdZ4GEu4M54sUD lCwov53WdfilKbKKWp7vyOtA6omgALuWsdhG77ZS6Ds7A2P5TIXQAxiYTifW6CwFQndT KRfsntl406H+ygApOjOUzY+1cMgYMY4lbVmTbRlr/L5/LjSkiIUPSjvJVHNcRBAR1ihe kkLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dubeyko-com.20150623.gappssmtp.com header.s=20150623 header.b=A0GIXMDU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z23si435293jal.20.2021.07.01.10.04.46; Thu, 01 Jul 2021 10:04:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@dubeyko-com.20150623.gappssmtp.com header.s=20150623 header.b=A0GIXMDU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232977AbhGARGY (ORCPT + 99 others); Thu, 1 Jul 2021 13:06:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232231AbhGARGX (ORCPT ); Thu, 1 Jul 2021 13:06:23 -0400 Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7562AC061765 for ; Thu, 1 Jul 2021 10:03:52 -0700 (PDT) Received: by mail-oi1-x22e.google.com with SMTP id q23so8014137oiw.11 for ; Thu, 01 Jul 2021 10:03:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dubeyko-com.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=M0Yqw0xxOZEekYTg3q3CvD7YLfizNegvaHh2b9l5Vmk=; b=A0GIXMDUpYvWxru961gfAFBLi6EXhfck8ja0MyrGOoL7HUOgoWq4tsdGQVzLdVYxYj mbJIrmLQwN2eLtby/ZSs1GYs3z6nAL2Csoj7vojKmmw2iJpi3391Jqe1T1pO5JuH6xP1 Ztw3iJ6/vzU6lnra/kmmax89ndkVyKC+AJmBZdy0Zubw0+3YLY+CWUnrKF1tQwhwlCOu T6+/FDxJu3dwKHhNTt5epkLhGjgjnYsp+vhz2/cAPs3h+qoiO9mbhX2jQEaF056IpjVT l78BNYNCOWG16pBz4B+hTsKg9TCHDZDBc9sbuDDUKzUiEpZEO3xxGHytjkhH6qDUxpS0 eOdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=M0Yqw0xxOZEekYTg3q3CvD7YLfizNegvaHh2b9l5Vmk=; b=J5ZaidIen4MUdcxl5XWdDwEjqHpssb87qiiLhrPrJ4wuwSt9maHHLNDas9kcK7VK7L n+Kml4vauwtjdaDWF3Vwm4fHRMduGRgaqwtil8RSPX2VjZP8INcsfPI4RTQstXr6w60K Hdc/GcWsvyRwwEcPirlEoBfVdIVBBQ31lYtnuU9aBzPMPdo2x44gt0BTpSGtd+Lz2H+k QvATRgn7jwWIFjwhhLT3/RVdPW5XuWReNkY6XLeGdTiEOTc2a3AgXCkUkrQorHagTFvN NSHb3zoOBQbPLoT97ahK/2Z30IC2t+Pqo/W+yy75b1tOQ5e0m79YHN2YgUpbzcri1S21 AVvw== X-Gm-Message-State: AOAM532ou6RuSU99d6X090BQYFtSQh8IAqb3RaODDhuygVeZWO2pND08 iUr+SwbueibiK4DX0hR+jJilCA== X-Received: by 2002:a05:6808:1144:: with SMTP id u4mr2133470oiu.133.1625159031856; Thu, 01 Jul 2021 10:03:51 -0700 (PDT) Received: from smtpclient.apple ([2600:1700:42f0:6600:4d57:e39e:c32f:13d2]) by smtp.gmail.com with ESMTPSA id l10sm57404oti.9.2021.07.01.10.03.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Jul 2021 10:03:51 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: [PATCH v2 1/3] hfs: add missing clean-up in hfs_fill_super From: Viacheslav Dubeyko In-Reply-To: <20210701030756.58760-2-desmondcheongzx@gmail.com> Date: Thu, 1 Jul 2021 10:03:50 -0700 Cc: gustavoars@kernel.org, Al Viro , Linux FS Devel , LKML , skhan@linuxfoundation.org, gregkh@linuxfoundation.org, linux-kernel-mentees@lists.linuxfoundation.org, Andrew Morton Content-Transfer-Encoding: quoted-printable Message-Id: <1A3F727E-8705-4164-951C-B2B99502998A@dubeyko.com> References: <20210701030756.58760-1-desmondcheongzx@gmail.com> <20210701030756.58760-2-desmondcheongzx@gmail.com> To: Desmond Cheong Zhi Xi X-Mailer: Apple Mail (2.3654.100.0.2.22) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jun 30, 2021, at 8:07 PM, Desmond Cheong Zhi Xi = wrote: >=20 > Before exiting hfs_fill_super, the struct hfs_find_data used in > hfs_find_init should be passed to hfs_find_exit to be cleaned up, and > to release the lock held on the btree. >=20 > The call to hfs_find_exit is missing from an error path. We add it > back in by consolidating calls to hfs_find_exit for error paths. >=20 > Signed-off-by: Desmond Cheong Zhi Xi > --- > fs/hfs/super.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) >=20 > diff --git a/fs/hfs/super.c b/fs/hfs/super.c > index 44d07c9e3a7f..12d9bae39363 100644 > --- a/fs/hfs/super.c > +++ b/fs/hfs/super.c > @@ -420,14 +420,12 @@ static int hfs_fill_super(struct super_block = *sb, void *data, int silent) > if (!res) { > if (fd.entrylength > sizeof(rec) || fd.entrylength < 0) = { > res =3D -EIO; > - goto bail; > + goto bail_hfs_find; > } > hfs_bnode_read(fd.bnode, &rec, fd.entryoffset, = fd.entrylength); > } > - if (res) { > - hfs_find_exit(&fd); > - goto bail_no_root; > - } > + if (res) > + goto bail_hfs_find; > res =3D -EINVAL; > root_inode =3D hfs_iget(sb, &fd.search_key->cat, &rec); > hfs_find_exit(&fd); > @@ -443,6 +441,8 @@ static int hfs_fill_super(struct super_block *sb, = void *data, int silent) > /* everything's okay */ > return 0; >=20 > +bail_hfs_find: > + hfs_find_exit(&fd); > bail_no_root: > pr_err("get root inode failed\n"); > bail: > --=20 > 2.25.1 >=20 Looks good. Reviewed-by: Viacheslav Dubeyko Thanks, Slava.