Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1779816lqg; Mon, 4 Mar 2024 03:44:25 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXSEuxRIaHCU2X6b36yBgTeRAemPbh0ztRKLdAYjJz7/Nhym9KJFqNrdZTN3W4GXS3z5fHbbytorknA9avx2VyXRbdVNY/W+LRceFEu2A== X-Google-Smtp-Source: AGHT+IFjGFy7RrC5rjQ1IJdbqZkdBJyNpCliUvm171cbgPnXxhEDo4p9H1wfuoQllfQmIpFkojHD X-Received: by 2002:a05:622a:15d6:b0:42e:f980:2f4a with SMTP id d22-20020a05622a15d600b0042ef9802f4amr336934qty.10.1709552664978; Mon, 04 Mar 2024 03:44:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709552664; cv=pass; d=google.com; s=arc-20160816; b=h7FEqqjInLwgxlfKLq7GjbISEOLLNfBsBeZ+dpgtdZY2wex0v4EYtZkmfhrHiPvqcw rQ2g9a3KKG7b6DeOzMuOmRF2+e65A853JzYx3nexTW5GJudA19GLt2gZ2iASnbZcbaPc 95Z3fI6kH8bH/dEcoAlB+nEA9o9RBrRbTXe4lzBQCqOXPdX2IyJJerHwRSkWxazrO24K f/lb301dBNl6jkZuV8YJ7uUQ29ubY/D+v2k/kvMuCeqc5kh9gn+stWV9sHIW+DD+H9gZ Rn/2+QeXtSSNTzeJFyKw4zeWPw1hzkEXsWo7YssD6WD3f/2cSF/Da11x+mfV6FoFM2xw maXA== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90524-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c15-20020ac87dcf000000b0042ef03bcb5csi1912689qte.332.2024.03.04.03.44.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 03:44:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90524-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=unisoc.com); spf=pass (google.com: domain of linux-kernel+bounces-90524-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90524-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B05081C216B7 for ; Mon, 4 Mar 2024 11:44:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 671493A29B; Mon, 4 Mar 2024 11:44:18 +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 ; 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 To: , CC: , , , , , 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: 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 424BhWrk006663 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 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); -- 1.9.1