Message ID | 1709552602-14373-1-git-send-email-zhiguo.niu@unisoc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-90524-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:fa17:b0:10a:f01:a869 with SMTP id ju23csp1363654dyc; Mon, 4 Mar 2024 03:44:32 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWeBnz0H+fd96f7VrwnGUXQE5ungCuUh/JvR0NgcllNyAQwYlLFJIw18ZSto9ds98ZjvOpC4VKt5HvY7n9j+7cQ+btjkg== X-Google-Smtp-Source: AGHT+IExPw77vN3197gGdHxiSStB2Ix2KpCXpEvNBukyr1WpKmk4/w1L+dDMWBuZa19nOm57Lijg X-Received: by 2002:a17:902:82c7:b0:1dc:affb:1f50 with SMTP id u7-20020a17090282c700b001dcaffb1f50mr8785212plz.47.1709552672222; Mon, 04 Mar 2024 03:44:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709552672; cv=pass; d=google.com; s=arc-20160816; b=kbceGBqc96fRYa19jKE8obVcFL6K8oNl6k5R/qJva1oQ1jpJMafuKUUIOOIpB3dNEf Ze0yxzGntfj/De1hcYhm0elaLLyAixKUPwZ75NOQS2PGCCRRF9Af4t091JEFkzcb5JrL Gf65pdAiC4e17ttDtlXx6+N/nMPsegcFxyneselfOjNRsoTXuRd8fXcSy74z7hL58y+4 x98P+CLcghXEhKhHL8UrLhQnEdmLdT0usJwN4vE4ERqzIbRq6549pRHwua55m82+VF7k tj9453iAyG+uuIgbXqAfu+bvrIicvX48yW0sPqV0t7/9g0MmJxbj5NKuUqc4drGJ2ib/ SY/w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from; bh=idO/gNsUAlPX0wcjmBTW4nBAkAXGMcrs/GZIcgdTEcE=; fh=r88ULmOhzmh3DE8RgcUXK+PF5Q+3czCYkx5yGhGfkR0=; b=bPSVrytVMqYM4EG1R6pAkfQkxZAU3u1u2bf+bud7X9/E+2YVwIhg8MtXUWg6s3mf/P UvMDncFQde1/5f3ckAzaNV8iqQgch4PtBzLFleQQrEQy26vrOmo2Gs5abENbJZUYoqQy SjFiOODGz2PkBWNpjeRZRZjCD23evYc+/SHrhd8cZB0m+yCxKCvYHbbq+G47TkVyI4si exLRX3joBHVlvIq6+0rL1hHKbnJreak17hZ4Cwu9hrE5DQ1LPpHQXj7QtORzTjtVBgDG V4eddtSc1Ormr3xZ8aKAVahDxYNtrz4XFzflCOCTrSpFwBIaFEL5ctCWRKXTLIwNgSqp AAgA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=unisoc.com); spf=pass (google.com: domain of linux-kernel+bounces-90524-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90524-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id f7-20020a170902684700b001db80f8fbf2si7881427pln.262.2024.03.04.03.44.32 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 03:44:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90524-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=unisoc.com); spf=pass (google.com: domain of linux-kernel+bounces-90524-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90524-ouuuleilei=gmail.com@vger.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 0D72F284C79 for <ouuuleilei@gmail.com>; Mon, 4 Mar 2024 11:44:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 598853B299; Mon, 4 Mar 2024 11:44:19 +0000 (UTC) Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) (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 A71803A1BD for <linux-kernel@vger.kernel.org>; Mon, 4 Mar 2024 11:44:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=222.66.158.135 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709552657; cv=none; b=FtAaVDCbqSv5QtWcs6hYEWQkss013YB0CcWB0gzaS+CDoznndknZODZcQ8R3r73EOUXUSNh557NDzopdr6SQzAOFnJAKmNXIpGfu9LxqBzwKoIYvwP/42oZAP0duP8XZM1KfHpdqxcx9nwgdiXdRR7jhUMEAwMSxIxTey/gD9lI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709552657; c=relaxed/simple; bh=5iF5ULb6UQAyIkEg3k/MDpf1xc/nJELC4HMPKOgxefI=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=WAuZtLGGP0Bdv7fi+0Rs0Y5UBAcHMuhXs29OPU4Ud82c3OkWEwGD1uDMn84FFfUXTmXeljg8tOA/BEHWYIe58XzLDHAv9OxjgzQr5DODOyM5V6zVVsfrV2IWpD2aqqQl6cqzkhdbUG0LVL5pwMOebSCTn8+RkE1PvGrxwyht2Eg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=unisoc.com; spf=pass smtp.mailfrom=unisoc.com; arc=none smtp.client-ip=222.66.158.135 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=unisoc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=unisoc.com Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 424BhWrk006663; Mon, 4 Mar 2024 19:43:32 +0800 (+08) (envelope-from Zhiguo.Niu@unisoc.com) Received: from SHDLP.spreadtrum.com (bjmbx02.spreadtrum.com [10.0.64.8]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4TpGyf2pWZz2Kr5R7; Mon, 4 Mar 2024 19:42:34 +0800 (CST) Received: from bj08434pcu.spreadtrum.com (10.0.73.87) by BJMBX02.spreadtrum.com (10.0.64.8) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Mon, 4 Mar 2024 19:43:30 +0800 From: Zhiguo Niu <zhiguo.niu@unisoc.com> To: <jaegeuk@kernel.org>, <chao@kernel.org> CC: <linux-f2fs-devel@lists.sourceforge.net>, <linux-kernel@vger.kernel.org>, <niuzhiguo84@gmail.com>, <zhiguo.niu@unisoc.com>, <ke.wang@unisoc.com>, <hongyu.jin@unisoc.com> Subject: [PATCH] f2fs: fix to remove f2fs_bug_on in add_bio_entry Date: Mon, 4 Mar 2024 19:43:22 +0800 Message-ID: <1709552602-14373-1-git-send-email-zhiguo.niu@unisoc.com> X-Mailer: git-send-email 1.9.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX02.spreadtrum.com (10.0.64.8) X-MAIL: SHSQR01.spreadtrum.com 424BhWrk006663 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792595902798328110 X-GMAIL-MSGID: 1792595902798328110 |
Series |
f2fs: fix to remove f2fs_bug_on in add_bio_entry
|
|
Commit Message
Zhiguo Niu
March 4, 2024, 11:43 a.m. UTC
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 <zhiguo.niu@unisoc.com>
---
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 bd8674b..2fbbf8f 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -761,8 +761,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); + return; + } f2fs_down_write(&io->bio_list_lock); list_add_tail(&be->list, &io->bio_list);