Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2674969lqo; Mon, 20 May 2024 12:53:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXwzZxniQOxSjlL36bZZkL2nyEXsQH56eEGujkmKVsqWtbsWVRHMHMaiYJRhBCOhFN3JvgKoiamIo8NLIzvi80qDjQgCf9Dn5zdZb8QNw== X-Google-Smtp-Source: AGHT+IEa4By+veS8rLpcqRu35CfcbxeZOBsIzLR/FoIyZoyp+aTPIFxVxePLBvWu8VT+ou3HH/uu X-Received: by 2002:a05:6a00:10c6:b0:6f4:d07a:d81f with SMTP id d2e1a72fcca58-6f4e0346a73mr30563310b3a.26.1716234791681; Mon, 20 May 2024 12:53:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716234791; cv=pass; d=google.com; s=arc-20160816; b=za7CLPg9sldcCqTGhQ7l3ohHs3R1xQC7oThzdgATwCugmauGc4BMicJYEVjmYR3dez b5tWevqGhNPqaSwnSlT/bIuaiXpewYuAJkahtYU6EpZGEcEof8IVRYghGV9G+eApw0dQ QjgLzSwcXNmUfo8TMI08Yoc3pL4N8TWZzKYQ4SHqrjSgRxHILhGxEoH3RuDGWjX95EZi cl4BecUS9OOPdOecLKxHPVTo6uo2WZVFJNo5fu20NScj1ptWZc/1K/LF9kz7rc/qtP/g YgTj9gxhnZ1FQfWvhlMdTFnn3dV/tfJ3nkoTbKI59SD0MNLCJGlj/+uvgVvfGZ0X8xSG KzuA== 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=XxS4trwBILGvT/LteDMhlTMI3aJP8RBvJroxNN1M98o=; fh=lq9VvzMTXiZZiH34mBjLSI5Y5nA2/c59sRWiAf8OASs=; b=lpjNQ+Edxs297/sLcnIWZpBMGgf5sn3ByYaCIbnxIwv9f20sy7FSFJx2V96or9vWj1 w7oJJ0m0CenJ1jIxDUZlbafxk+3ES+6Z8EK5YlMuCGtyyFAGA2ah/wbCVsk7Eu6IaMyr IoEIDewBgW3hIpzAm8QYB+2dVY40Gw+UBPYPiWXpFJf7tGrpYe0H7JaqixncnV/HSbLK g0IRYqXfdb9hToGh17sMBRU107JsaXZ/eCAOZjxcG3XrezuqpOMoG309oTPTjpmmcG9L ElujtO1VMkVa/DQ3Ngl6GuCRZtv/jrksKOJqV5tOCnEPVy7HiOz3uPnTom5VDAUF/0gc 9xmQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Iqa3Dbbq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-184132-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184132-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2b4295asi3813520b3a.358.2024.05.20.12.53.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 12:53:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184132-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Iqa3Dbbq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-184132-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184132-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id AB2D1B224DA for ; Mon, 20 May 2024 19:52:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8511C1386C6; Mon, 20 May 2024 19:52:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Iqa3Dbbq" 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 B01C61E4BE for ; Mon, 20 May 2024 19:52:27 +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=1716234747; cv=none; b=iO0mfUvjOEXNvibjd54cFRnWIsHEX0i72rkOIjXgRZtr+NyFsWaaWbhayOY8xE2AEFf+HyWcuxPafOVOAd5cL/GHh0mucVGTBUu29B2v9EI7/V9vy55xLSsUZWBc3NX7O5fawP9/g7MGt7KJtdIaQrwDNhJppYLqIUecx9wNVL4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716234747; c=relaxed/simple; bh=U2CMoe4AE+nyQy1FyMvXOkw8VyQr9iKivbdDeG3xG14=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AnPFuWtfPblxON+KYy9c8uEiJiGticyBNu/RIFyx31cV/VyAh1Mlz8xiVLU6frcefEzzVJ88jbXzLyRs5gNpyi3uq7kzojFGutwdr+VIk8aLbFstdUfIweJUyunVvOTNYPi79cNr1EACdIZ8ZGZHU5wJBLR47qCviEYav85FakM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Iqa3Dbbq; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 358BAC2BD10; Mon, 20 May 2024 19:52:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716234747; bh=U2CMoe4AE+nyQy1FyMvXOkw8VyQr9iKivbdDeG3xG14=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Iqa3Dbbqw6bpcrwiqzWuFRKSKf26vkkvQdyjYxaiKydiPjx+mQa241ogQWQ1dVsTB vgl1VptkRMvH62nqQiHZ5qdFdkG3Ut+gKKqA52Tu/g/u+Ufm3TGT1gOHLBiurPhFmz R/jPduEWkBgO5+ipRPGa/AjXyNfUHSm7j83ismgOz5obIMCqazpmwI1ftW0KMVy9h+ aauX7E58FTGv7+Ra2TE/CHrdyaLEXRjVRNdCNOsINIgPii80fDFDLNmjDLpRpBz2yc PG7AcoJzwCWeMaxBQWEDZfVUA1X57JWvOnrm+0iQxzNZaq/JZAqiUY7jutGYyjDJLf tnqXGvCiLEPKw== Date: Mon, 20 May 2024 19:52:25 +0000 From: Jaegeuk Kim To: Zhiguo Niu Cc: chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, niuzhiguo84@gmail.com, ke.wang@unisoc.com, Hao_hao.Wang@unisoc.com Subject: Re: [PATCH] f2fs: fix to check return value of f2fs_allocate_new_section Message-ID: References: <1715945202-30045-1-git-send-email-zhiguo.niu@unisoc.com> 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: <1715945202-30045-1-git-send-email-zhiguo.niu@unisoc.com> On 05/17, Zhiguo Niu wrote: > commit 245930617c9b ("f2fs: fix to handle error paths of {new,change}_curseg()") > missed this allocated path, fix it. > > Signed-off-by: Zhiguo Niu > --- > fs/f2fs/segment.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c > index a0ce3d0..71dc8042 100644 > --- a/fs/f2fs/segment.c > +++ b/fs/f2fs/segment.c > @@ -5190,7 +5190,9 @@ static int fix_curseg_write_pointer(struct f2fs_sb_info *sbi, int type) > if (cs->next_blkoff) { > unsigned int old_segno = cs->segno, old_blkoff = cs->next_blkoff; > > - f2fs_allocate_new_section(sbi, type, true); > + err = f2fs_allocate_new_section(sbi, type, true); > + if (err) > + return err; I hesitate to apply this, since this may give mount failures forever. Do you see a real issue with this? > f2fs_notice(sbi, "Assign new section to curseg[%d]: " > "[0x%x,0x%x] -> [0x%x,0x%x]", > type, old_segno, old_blkoff, > -- > 1.9.1