From nobody Thu May 7 16:03:42 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5828FC433F5 for ; Wed, 25 May 2022 01:56:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243009AbiEYB4q (ORCPT ); Tue, 24 May 2022 21:56:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239239AbiEYB4o (ORCPT ); Tue, 24 May 2022 21:56:44 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6CF72C675 for ; Tue, 24 May 2022 18:56:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 58A65B81C03 for ; Wed, 25 May 2022 01:56:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60E9AC34100; Wed, 25 May 2022 01:56:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653443801; bh=hNHaLYvjKeAxDgpE7qKiVuYLTc51rccayDM5S5yqzkM=; h=From:To:Cc:Subject:Date:From; b=HqxwfzFzjDfU7SRG2BfRajIWClMs/kpuOLa7VZSBEcKwmOLSA59INHgjGSVsInWbH LwF5kFHXstg/igZgSGOAfkyIQscBp3ooPWZu8gETaQv166TBhp9822sp9BzpkZnKBk JNprhK4E36cUR4DROICWCn98CF/7fXLuQ+BwlOE9cU67myilCoNNGryY5GIFGaynVM QPJWPO/cvoUmHH4/JL+yNuquUQ5ce3zThpu+ss87THXaQqSHC9lltCvwJ0YmpckV3Y S6gqbypEPXC3+0OeMj6KfzxBXFucawEwA3KPKUJ+13N59lzY1zfUQm7AJfRxlD67rj RARZDR10TZ+Yg== From: Chao Yu To: jaegeuk@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Chao Yu , Chao Yu Subject: [PATCH] f2fs: avoid unneeded error handling for revoke_entry_slab allocation Date: Wed, 25 May 2022 09:56:34 +0800 Message-Id: <20220525015634.3985529-1-chao@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" In __f2fs_commit_atomic_write(), we will guarantee success of revoke_entry_slab allocation, so let's avoid unneeded error handling. Signed-off-by: Chao Yu --- fs/f2fs/segment.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 0a4180f64291..51ceff797b97 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -315,11 +315,6 @@ static int __f2fs_commit_atomic_write(struct inode *in= ode) =20 new =3D f2fs_kmem_cache_alloc(revoke_entry_slab, GFP_NOFS, true, NULL); - if (!new) { - f2fs_put_dnode(&dn); - ret =3D -ENOMEM; - goto out; - } =20 ret =3D __replace_atomic_write_block(inode, index, blkaddr, &new->old_addr, false); --=20 2.25.1