Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp176754lql; Sun, 10 Mar 2024 20:54:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVNjvIf3reQkqCF6aylTAPrx4NeNEqnErOrC1+Ms+ag8JTv4aiKywQoAtTsExjCrmmldK9Tjb85tv44M/Y3sgh0iXoUfF9txx+uNSUi7A== X-Google-Smtp-Source: AGHT+IH9R27Cxwi+v5NW0/zW9I+87ut9yQIG7X2+tU6BjAcnmjAAocBZwWuxcrlvXoebbiVUhVHF X-Received: by 2002:a0c:f804:0:b0:690:b876:e835 with SMTP id r4-20020a0cf804000000b00690b876e835mr5435066qvn.30.1710129253608; Sun, 10 Mar 2024 20:54:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710129253; cv=pass; d=google.com; s=arc-20160816; b=y28r/anhQKawraTXZhP98Wge8uBoQILS+MIzpM8pky2pBYDa3dEfDzmr0P++fOAnWq t+fx8gu3dnATGkNBPifp6ITUE0gPPBzPLGyOPTmm7VuILTw0DGjo8I5vetYbfjd12E7I oyI6+uEPnhUt/zFJ2wlKLPU2fmozwdKcfcEtEfE6NO/YlIkaC9OaKrOAat4FW1lZHjqh DGFr1tNNkg1oOS/jyfaTB1jJ1gwI8GGyY/iFZqzAmF0WNM86vymJDTdNcini3cwkv4LA yUszDsg2IyO5Ex+bq7iiZtf7WNgG3Q/YJLU/rhu6op/p9h420+VhxBzQox6jaEEv0hRJ CxbQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=hmrHm10wj4Tb0bGho1Z58ygYEQnvQVnCl3niDspRG9I=; fh=W6COFBd4BX4Q4YpnsinfP4Lifuq45kIfChsHXFM1YEQ=; b=o0fHeX3Z/YhF47oVZnzjFCDSLgxytojEHrs9xxNjZDXy2S77u1dL+2jINwEG8p8qXA IPi6yw/RDrjm/Iq5dnUJDcPC0jsZfgB9YZQqHWhBw9HVNqiz4ZQYBhh0oAoMffy3vHJK 5QuwWl63uOCUkE2PpEeqpyp/BEFtvJM+nlQt22Ouj75/PgAL9SB3l/ONoqQFWc6mfkT9 SDR6YULuYxZQS4gBhOY9aKsUGlobE0wQtGekGAjwEojJD9rNh9eVTSt9WOsGu3PGWe8d SOXcLLQ3rVxm0o5b1YBCZ1Mr0QB3lRTcUgmVcuRvJThic3CYLdgtUqC6ZA4JPOwgFJHX sNTQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hZvzXiNj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-98440-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98440-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f14-20020a056214076e00b00690193b693dsi4588329qvz.87.2024.03.10.20.54.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Mar 2024 20:54:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98440-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hZvzXiNj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-98440-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98440-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 572A61C20D38 for ; Mon, 11 Mar 2024 03:54:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4BD601C33; Mon, 11 Mar 2024 03:54:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hZvzXiNj" 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 662FA16FF4F for ; Mon, 11 Mar 2024 03:54:06 +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=1710129246; cv=none; b=HdkDIhanb5mK8meep+QNUxmVJuVEEOcsg7FeRnKSNAk6XhaFxmaX9p+HigbkzWX4UgUVY8vkV8AmTbsTLdZz+T5ZAA9Pg6B5br2ByTVFjDomvAsm2gb3ifUlclnZVmDhxPQOOdsOCmp13OtUuNqOF+uaj9l2Q+2l35uFgXSEwhQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710129246; c=relaxed/simple; bh=1j9WPfieMKDOLQaDOS5Cyf1ofMxyJtJqnuJPUaavX2c=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=HFd5ln5aFU2N5YDf1C1/+c2hfqRC0WTmt2W0oHhEE79Gt/X5IkSjVevAu87kUvmsbWWewunzPkbWQoSJow/gGgl4S8rsHl2ZFZdezBHt1HuRHiLqg6NN542dF71qHss1JLvh8gwz5W1PaWrAnNkLHPdPJ/xp3laXAkGfGiDeXxk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hZvzXiNj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CFBC6C433C7; Mon, 11 Mar 2024 03:54:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710129245; bh=1j9WPfieMKDOLQaDOS5Cyf1ofMxyJtJqnuJPUaavX2c=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=hZvzXiNjsjR/mLRkE/q4I81NWyTDrFo0xIdWF/5dizanAOB9U7zt0jTzGX1PypYTx R4EbNm3v2V6btBh4kiGSGeVqC4gO9kzuzOojCxCrsGCrUlmzSZnPoLAn/008qySkIR QfUjIgcqsR8G0NcF8B/b76dLWwHIXNb2+mGmEHVJdnwNzD3E0ARmDxHv23Sa1o95Bi 9V/dCZ7w5Al9K/kpJP70kp7FvHOn3IvZq/Osv1uXq0BE+tvzEPX8ibzxZZZEYqyF7P vmzkiY7J3nU7fTBviIZpFFMgcNyCuXMzVAaC+2VFjgxUiQ5h7Lpgy/B38iD3dNsoId wWIhLVBq5OZiA== Message-ID: <67a7f35d-5cc3-4b5f-968a-e4151c63eb74@kernel.org> Date: Mon, 11 Mar 2024 11:54:01 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] f2fs: fix to remove f2fs_bug_on in add_bio_entry Content-Language: en-US To: Zhiguo Niu , jaegeuk@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, niuzhiguo84@gmail.com, ke.wang@unisoc.com, hongyu.jin@unisoc.com References: <1709892753-27461-1-git-send-email-zhiguo.niu@unisoc.com> From: Chao Yu In-Reply-To: <1709892753-27461-1-git-send-email-zhiguo.niu@unisoc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2024/3/8 18:12, Zhiguo Niu wrote: > add_bio_entry should not trigger system panic when bio_add_page fail, > fix to remove it. > > Fixes: 0b20fcec8651 ("f2fs: cache global IPU bio") > Signed-off-by: Zhiguo Niu > --- > fs/f2fs/data.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c > index d9494b5..f8ae684 100644 > --- a/fs/f2fs/data.c > +++ b/fs/f2fs/data.c > @@ -759,8 +759,10 @@ static void add_bio_entry(struct f2fs_sb_info *sbi, struct bio *bio, > be->bio = bio; > bio_get(bio); > > - if (bio_add_page(bio, page, PAGE_SIZE, 0) != PAGE_SIZE) > - f2fs_bug_on(sbi, 1); > + if (bio_add_page(bio, page, PAGE_SIZE, 0) != PAGE_SIZE) { > + bio_put(bio); I didn't get it, why new created bio has no space to store one page? Thanks, > + return; > + } > > f2fs_down_write(&io->bio_list_lock); > list_add_tail(&be->list, &io->bio_list);