Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp237079lql; Mon, 11 Mar 2024 00:26:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWa66sO1BZOgHUxN+UvotYjFPMBsAZ8iLHuAeJIF1Id3BDFZ6tV7Cvo92cBkNGyISenz/Vm3nf6KmEcKw1dGQuY51AAhBdiiJ8yThYKsg== X-Google-Smtp-Source: AGHT+IFKyUCnILp9XnXAi2YcrJqAZ5gfd95enEopU7jpMWJyt0QFiB1ht+Lsl/DQawebdwnDul0c X-Received: by 2002:a05:6402:5c4:b0:564:5764:a5d8 with SMTP id n4-20020a05640205c400b005645764a5d8mr3640545edx.25.1710141988434; Mon, 11 Mar 2024 00:26:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710141988; cv=pass; d=google.com; s=arc-20160816; b=sHLdBPse85fk001XAM7ab6ysYlJH58/RYs14Nltm6K/vYfVwATT/tUed+6ODeFdm/x 7cdzt8pyhGtOWEFuKjnOcGwbmRCuYtpPeHxKb5q7h3mp2YU1W10S7qc6CaetX1Xm7EWZ KkCvml/x3xxZPyDOIwf2RzweTYH29B9xXVWZUo0bHI8JH8sVb20fGXhd1PigvL+2XgpY ln/12i2oSUPLXUoab0LZeUHY1Ja5NEQbBJN2r8AQ86pb7gu8xmPx2dFZpTxmvKQic+jf and9gOBm5kjua7l4cE1LwfOnVqpyVotDcckIBWSjQmVwFJ2UHy4BbK7UH3xLkByQGArD crfQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=nWkn4Jgv2vGWKej5ZM1NioOSMWReqWi9UHuS9WHYkl4=; fh=6K3RVUWvP7t61wjvdT8zqp0oosNWCtGM1aaoNN9Otsc=; b=syU4mPhEW8FsP4PiGq2GputMnQto8HTPI80oy+xjMcO94hlMGC+irdVJo9oAFCuGDI p6vVZhoup7fRttJ2gkIFxH1IzlyzAXa7N+jMwrccWq6JDvmX+ouu6uR15dHRQFjOauUN /4Iuguz2XM7T7JBQq3/yfiSBaCa7GFL8Ro1SOm3DsN2d1dPnlWBQfBwHcODO3sPFkdDs hzXxASrmv4K/2KzrEzXgud5ReQgEgADd5IVzb02kEyBJY+bBUiWUxDgvU7nh3KYGBxPx GbPxbl4a5m4dhZvRkaIfNqAwKFPA+vd8a55YjymeQ+wim9uWM50jrqyRRSF42j/KTV1U q2IQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EqOMGGwH; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-98514-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98514-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dg6-20020a0564021d0600b00566a1dd07e4si2189787edb.495.2024.03.11.00.26.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 00:26:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98514-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EqOMGGwH; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-98514-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98514-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 27BFC1F211C1 for ; Mon, 11 Mar 2024 07:26:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3507B1079A; Mon, 11 Mar 2024 07:26:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EqOMGGwH" Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4A181C20 for ; Mon, 11 Mar 2024 07:26:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710141981; cv=none; b=KhdU869s+asGSltRWORqKeIutmz19X94I/YY1fkoSrnvPi2e08IqgRF1mDPydMrW3gFNUtW+s5D5qaxZs7z2lht3QTethUDuiYX4MW7bSiyLGyzSTVgEXLsLlik9T1FlRJB9X7p6AFsnP9QauuX/mkRMf55tmF9CML7WKazPq7g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710141981; c=relaxed/simple; bh=4A1Ch0SnOg2vriHO4K6Az87fQ2K5aKoZjo2rqINki10=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=doZjGDei4AUbj0DQGy445DZgAx5aMka9zArUMVWZinO5yS1KDSbTen8wjIODkxn5JI/umYuQl9DhRZqrn2AOPushJA0VTehyeEHaVEHooYsWip8wINlj6OzG/1a+OPQmj/5JZlBmLzWPkEhlsNfnIFW0V5cTFkhZ4NKvQotjhn0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=EqOMGGwH; arc=none smtp.client-ip=209.85.208.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-5682360e095so4258781a12.1 for ; Mon, 11 Mar 2024 00:26:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710141978; x=1710746778; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=nWkn4Jgv2vGWKej5ZM1NioOSMWReqWi9UHuS9WHYkl4=; b=EqOMGGwHfe4zytqQdHkFJqe0UW3dFKCCWDtXidiLqNFwuJS1TQ2/nQJSmZFj6Xq3vu TpoKwr4QTqRLKbOds/fDrPhKnKh13KP3pNpY6NP1Db/+HPoOJcV868VhKO2MDaa2Wu6U VilQqbmuwOYZt5Zuy2TV/sQLyaYGY/UAE8hDGbXIPwLMvwpE/I8iiwXuYYDkFfjGqM9u B2WpGpzG1Z7ZEMDXj1K3Sgd/z9RR1Ahvo/QRm6DR51RTHH31lVPZUct337jcL80lZdMq VxiYjcfrfA+3zXDpmucB3IwpBMSGV1wUGSYert6hKR/IY2XAE6niq3WgYpf5lXF427dn noag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710141978; x=1710746778; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nWkn4Jgv2vGWKej5ZM1NioOSMWReqWi9UHuS9WHYkl4=; b=HyBQx9UUVXtOSymst3iPytnA4TzleFFT4Iol5jk5qFj3i7IW2NHXap5J7u8xDhhYc9 x7O6bKNGziTK/sfFR7t/NIlrSIrsES6EPywR92M6YYywPdEkhhjomqjJ7fWizhgqxd9L N3VGHbX+VyIj+na/CKKPWAGGJRhheungzYo2Qd3oo4KZ0YcbG1dFA/Dx0H/6WoOrmvk3 TL2IrZrpGJ2jwckXERsZ6PoRlBSekyTMDuQpxuXxxcNHsyp+0JfB8UGPixZQaY2KpuLk UI7UuI/gtNX0Rn8Weu9IC3d3Boxrac6+ia6Re6BsoiiYyIgejYZ2H0aiYKgzv+cfVq7v ZJog== X-Forwarded-Encrypted: i=1; AJvYcCWm2rQ/iozSfWf6CcKCcepvfyVzoHPXbBSWf3Q22ANDtwqyJVwq6IvBNlEIY2d8I3rOnpw6ElJY+ARIoZryxWqCgsMIesdWBOujKpg6 X-Gm-Message-State: AOJu0YwZ6OkeFjc6O6JDLWROqdJzkFhSapAObFTrw9O7S9xBSjkS4Wne OPOkT9zkRNrv7ofeDxpBXJptPT2HKaGvxnRI6NOUKPe4XLK2F63EU38V3Cy/lUrM2KDin6EJ09Z 9g20Z4yASjQmNUwX3OPBXs2Gr15I= X-Received: by 2002:a50:bb4c:0:b0:566:49f4:c538 with SMTP id y70-20020a50bb4c000000b0056649f4c538mr3608881ede.34.1710141978051; Mon, 11 Mar 2024 00:26:18 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <1709892753-27461-1-git-send-email-zhiguo.niu@unisoc.com> <67a7f35d-5cc3-4b5f-968a-e4151c63eb74@kernel.org> In-Reply-To: <67a7f35d-5cc3-4b5f-968a-e4151c63eb74@kernel.org> From: Zhiguo Niu Date: Mon, 11 Mar 2024 15:26:07 +0800 Message-ID: Subject: Re: [PATCH 1/2] f2fs: fix to remove f2fs_bug_on in add_bio_entry To: Chao Yu Cc: Zhiguo Niu , jaegeuk@kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, ke.wang@unisoc.com, hongyu.jin@unisoc.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Mar 11, 2024 at 11:54=E2=80=AFAM Chao Yu wrote: > > 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 =3D bio; > > bio_get(bio); > > > > - if (bio_add_page(bio, page, PAGE_SIZE, 0) !=3D PAGE_SIZE) > > - f2fs_bug_on(sbi, 1); > > + if (bio_add_page(bio, page, PAGE_SIZE, 0) !=3D PAGE_SIZE) { > > + bio_put(bio); > > I didn't get it, why new created bio has no space to store one page? > > Thanks, Dear Chao, I got what you mean. We are doing bio merge optimization in bio_add_page. After looking at all the locations where bio_add_page is called, and think it is unreasonable to panic the system if bio_add_page fails. but it is not impossible to panic in the current flow about bio_add_page. so keeping it as is is a good choice. thanks! > > + return; > > + } > > > > f2fs_down_write(&io->bio_list_lock); > > list_add_tail(&be->list, &io->bio_list);