Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp451238lqc; Fri, 8 Mar 2024 02:15:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW78noEQ0uhcD1mc9M0LK4Nz4A2e9osGsnS8VVFdwO0kFTSAEzjr0CuxfZ5V2faQa7bx6eU2wwsvyjbpMEBROEtliOJkhN8pWj5sKiong== X-Google-Smtp-Source: AGHT+IGD/bEGFoQkAulMzzfbjTCbpQ07/hZ4LBaHHbXYxeR5gso+lkO8e+oDbd8LAO7Y1s5xmxZr X-Received: by 2002:a17:903:18f:b0:1dd:6781:49ab with SMTP id z15-20020a170903018f00b001dd678149abmr1791857plg.59.1709892914736; Fri, 08 Mar 2024 02:15:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709892914; cv=pass; d=google.com; s=arc-20160816; b=kCE648lL31nlRlmMxelM8M8YQ12SeUk42AvfscKkgYzQ+fjNoxLsrZgjEh0x1E4dEK 2a7kuEs9L0e5oEF/vCAlHNCRLTClopInrKe1jKOBwkxoJwS+dxfFyzQ0GLdYMle+J0K7 1FMlR0q7wl6iO2Ad9dwtkTH4f3ZVTQam9gvQiDWyXXtmtzraYt/SyqrT6uD2ff9aGkVQ UxXfthRS6lnv74PAI48katpD8+3WqGkiyupHjfim86BUurGmneQRvT3O0sC7+4fKyciB Sq/gOs4+50efbKnwuleY//cPZfeUFpTPrfd1zTbzhxl9aV07GJx07fkR/yZ0LvwqVnM0 IlOQ== 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=ZmqGTA1O5hIrbBXEdx0MrBO9wv8Md09XBJjINf6MQ+Y=; fh=r88ULmOhzmh3DE8RgcUXK+PF5Q+3czCYkx5yGhGfkR0=; b=e4Epsd56/YrCsi3xbaVl/5akg7anBgm+IAboYWmvJXqGUdwfc5JrMl1Lp5xyOTESl+ SyocAQoXwGMcMaOgiVt3A00MB/1sRU/Il0cg75Ba5u6BiomeOYyIbEGcKPXrySorjctF FXoU0NEu5wdRSTiHnkxrZywmEQbHuJz6dH6MBBOkC5mZjmojOpGf5AZZIjBdElEDcPeB uQL4bTkbASKJA9MUpkfZwweBl9EBRyyUnhFXzjwOT0HvOoJKJpUA3Co52GSu+Jd83kOu oGowSeM3RRNThs8ow0+D6IyVQpRl9yQEwMvOwp/DpSplJnSQACyglXQ5C6on3edFiP8a Frig==; 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-96805-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96805-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id k13-20020a170902ba8d00b001dd0803a2fcsi9793317pls.58.2024.03.08.02.15.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 02:15:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96805-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=unisoc.com); spf=pass (google.com: domain of linux-kernel+bounces-96805-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96805-linux.lists.archive=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id CA90FB234C5 for ; Fri, 8 Mar 2024 10:13:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 959DE53E1A; Fri, 8 Mar 2024 10:13:13 +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 683B55381E for ; Fri, 8 Mar 2024 10:13:09 +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=1709892793; cv=none; b=JXACDrivwGgQZBtQiDrtaBD4PLBxfMXTVc5gcEepv/fwI/MsMEO0zHtKlYfhSafjRzUz6U84ryX7yYddhnQRU6mFumu/o63iwYsPYsTkKSpqI26AyEchQe61IPegmfIpIXrpQ/IgfHRhZgNwYLW/G/uQLgD94YpF4vC7yQe/Ds0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709892793; c=relaxed/simple; bh=WeE17r77aXKxwoNW7bW5pS29OZsiQmX2gOInE1lutwI=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=nqS5Vg0Y9UbIpkL24nXScMgFCBl5ztDZIY7qzEcA5gYuraJldgH+/L84b7Jj7xbiIIsVJkENRlo03YzFnpLDPgDQcxEDIliGCDnPhcYCK5JAoiSMnUcrV2tWH/aZBs+tFC2ra6Ak4XzA/1nE6TT2lsXB1Sfa1eongsVnOd1QfqM= 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 428ACbu3067848; Fri, 8 Mar 2024 18:12:37 +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 4Trhll6Yxwz2L3SH2; Fri, 8 Mar 2024 18:11:31 +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; Fri, 8 Mar 2024 18:12:36 +0800 From: Zhiguo Niu To: , CC: , , , , , Subject: [PATCH 1/2] f2fs: fix to remove f2fs_bug_on in add_bio_entry Date: Fri, 8 Mar 2024 18:12:32 +0800 Message-ID: <1709892753-27461-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: List-Subscribe: List-Unsubscribe: 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 428ACbu3067848 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); + return; + } f2fs_down_write(&io->bio_list_lock); list_add_tail(&be->list, &io->bio_list); -- 1.9.1