Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp844056lqo; Wed, 8 May 2024 17:47:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVuLmJRhBh4tvqyWrEVjv6ODUijGrt1uOfdcS6wUarCZrsByBHyW6tK8scRz1fEcQjUWgSa94J3EKAUuzt4LGUr41LbcldAeXrXNf5RaQ== X-Google-Smtp-Source: AGHT+IEkCKRNfzGzbLTvfky2SkdvN/cwgnfiLKnOWAKQkl1hYHUYOIXxnNtdTE1N2JEdLcEniBd8 X-Received: by 2002:a05:6a20:5a9d:b0:1a7:a2f2:c70b with SMTP id adf61e73a8af0-1afc8d26f47mr4350156637.22.1715215645879; Wed, 08 May 2024 17:47:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715215645; cv=pass; d=google.com; s=arc-20160816; b=zeElga8NgHEEFrdA+07+k8rVTA2huSNT+fDfZx1vX3qsn5sUOTltrD4S7pxT9XhM8s mV0J9ddM52DKBJDscOe4h5KOzlB5Lb0S+8etbu4gKGVSuVklgOxCbZjiBIIARxUKivtN eig93ZMVejRIyAendnKFSmFf+slSLnNh0c3wNHeMKLZU5y2eCF2NWVEAw36AFq3J5k50 v7BAUoSd7sgFpbe+dTMdfv0Y+X/znVAmEjncJxT9aLdg8YYm94vPEmQ/MY3mZyAecCwn WSD54xWdxLhvhn9YXUlI9OPSffysAGHpUCVWHlpa6glwSbqMvGsz2hhTGy4bp77DCtvO gMIg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=gNPmiJb/3TX00gU3ojtAgUg3W+hYTAhCOOACKIqA6qE=; fh=/W2dXBmPOYAkmC9wIpZGDoyRD7a7iUo6ekQ/c7AKhqw=; b=linAgl5yIEu5DyRNDhdgklavU6r6ZsYpTFIknZFOL0OUUX5MVdaZQz7lwi29wWrgFw s5xp2KOLZSXsr5dIjHijxri8dg3YQZ0LlP5MuTMuZahA7rcVIJlJGqpcAj8FwiUrO0yj VnpDcgF4KTDbizPgCzHlspSsCKcZJAPG3cqT3GeAFMIJOvtV/QHfOkTjPACJvO6y9CVx COPmSVwSkDqXuVLhU4Dj9CAzbgEt9h4OuEe1vpb1WPBkYRbG2exxrZ6cgJuE4FUxmpAd MMexW2XmBgkoJ56NwG6nJW0FB1Gjw9yqyoTapaMrgcaLAmCjMhC035bcOLpP0X5NvIWa xyiQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=brH3UiF5; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-173983-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173983-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0b9d1376si2918955ad.71.2024.05.08.17.47.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 17:47:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-173983-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=brH3UiF5; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-173983-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173983-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1D497284452 for ; Thu, 9 May 2024 00:47:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8796F3B2AD; Thu, 9 May 2024 00:46:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="brH3UiF5" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC578364A5 for ; Thu, 9 May 2024 00:46:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715215592; cv=none; b=sWKal36WETeM68MJLy8oDvgKizbQmOXPyrNYAVUOXL4KK3jyo3msW+TFamx87erEK4FPtTFUC4XABrhjUlSAZyzKQJB2ishdW5WaFsd6+rD8wzTtVMEYLtNNeIzpYtO4yM8pr2Go5mjEtf+GU9Knud6J/6djOVFJCnog8qbrFRI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715215592; c=relaxed/simple; bh=zYzZ47aIbLYgJWhf+ax5I/IicovIZS8EJW8+BM1aTIU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JadPB4J0crMVvzSqnqmlhja00GJbW7zCXcZSe2XZW5fSUSCVI3GyuDLqTCp9ZEROxXWBpgK0Ai3BwF6DYUg+DWpkvFxrl1scrPCK09GY53haODdTPrDU+74ixsyAZC2tuqo8RhzjXQjUNPyzGczO8q7aOD7aBYQ6WiJanA2fhfY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=brH3UiF5; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F004C113CC; Thu, 9 May 2024 00:46:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715215591; bh=zYzZ47aIbLYgJWhf+ax5I/IicovIZS8EJW8+BM1aTIU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=brH3UiF5pKt7B9d3J3arotQt31ROL88isqOCQma1jlku4vDpHehmVMl/brEbHudaa A1g4FN7fUUsLQRN/SCvIq6U8dz2dpos4PASMDL8QSvbx5QM2LmwrAhYBhuM6ErOdA5 xtyY8RTWCcBNXphNN3Y0GvkfXGUktkFiPNx3Q3zq2AZn2e33fzKHXszB5/0o0dwAcO /mzW/luTIEkkDec/fmsCMkgs5EcWk39ppyBflIgLl58/WOUBIlwDi/RiswYgiy/eow SOUS0HDDnCxcA4LNIoJ9UgFjR5zp2EVmMyLooe8/mvmft18UJ5/Q2FadNk5+UxB2Vx 3dQSeb4lbplIg== Date: Thu, 9 May 2024 00:46:29 +0000 From: Jaegeuk Kim To: Chao Yu Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] f2fs: fix to add missing iput() in gc_data_segment() Message-ID: References: <20240506103313.773503-1-chao@kernel.org> <20240506103313.773503-2-chao@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240506103313.773503-2-chao@kernel.org> On 05/06, Chao Yu wrote: > During gc_data_segment(), if inode state is abnormal, it missed to call > iput(), fix it. > > Fixes: 132e3209789c ("f2fs: remove false alarm on iget failure during GC") > Fixes: 9056d6489f5a ("f2fs: fix to do sanity check on inode type during garbage collection") > Signed-off-by: Chao Yu > --- > fs/f2fs/gc.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c > index 8852814dab7f..e86c7f01539a 100644 > --- a/fs/f2fs/gc.c > +++ b/fs/f2fs/gc.c > @@ -1554,10 +1554,15 @@ static int gc_data_segment(struct f2fs_sb_info *sbi, struct f2fs_summary *sum, > int err; > > inode = f2fs_iget(sb, dni.ino); > - if (IS_ERR(inode) || is_bad_inode(inode) || > - special_file(inode->i_mode)) > + if (IS_ERR(inode)) > continue; > > + if (is_bad_inode(inode) || > + special_file(inode->i_mode)) { > + iput(inode); iget_failed() called iput()? > + continue; > + } > + > err = f2fs_gc_pinned_control(inode, gc_type, segno); > if (err == -EAGAIN) { > iput(inode); > -- > 2.40.1