From patchwork Wed Nov 1 04:26:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Bo X-Patchwork-Id: 13442523 X-Patchwork-Delegate: snitzer@redhat.com Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2094.outbound.protection.outlook.com [40.107.215.94]) (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 9094B1841 for ; Wed, 1 Nov 2023 04:17:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="pQyLNSJR" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kh8EHb0hRlrSb8v1Flem9v+lvIcw4CqlHCSRLeitmQrGuxqITaIXagGGB0lHNbo7egs76kDO0He/ApRzavwxDlBbw/gMhztv2E3NGpak4xedHCoiwmuxw1N2GY+QGI0hd+V+RfZWIOoWtwtUgn4q4hN3LBugMB4AcU0yyHH+TXxukWDpEbV4DUEHMfR/mHpIErJv1Uk+LAweZ5+4AP+3L70xTCciARMQcKQryaOVIOkIMto4/z0nfh1Lo9a79nyf2cpIWCQidBeye6WhgBRyyO3GoPHqrp6/EcQX+hqLC22VsV4NaRFVqekUelNdbV8Ue+0XDSZEineyEnh6qwcoTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aKxPqIwRH/0UToZwAf5WSBo1aM7Z/qtyoABIMGpuuVY=; b=eLoxTFaPrUdZFiQqa0g1LqDulr25lViHn1MJ2gD+FLE2WRAnQ41ontgjn+dZoxXqGGJRHsBEfZ++m8KsIkZmHpHmAhK1GSQY1UmKfdY2bLlmBJSp5nwAWmyeyXHGJ4Yy7EZpdEkOKldmDOw3mOyISfoNivPwlmkUHpA5XksIMYuTQ5QuQ9oCUVdD/jW5CVs5soZMDmKCwEb4jZjNXJk0SN7cPJroOGDmdxo0iEAOtgXCLYwQrk/DSz2Cg/LJvjrpiNo2AI9lHmkCvFuRMa4QGXh0POHffLwNJXMprPn9rfzplL61hcDIQZRai1Qbwa49EXLo5/BjVWn3NUYWpT8C9g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aKxPqIwRH/0UToZwAf5WSBo1aM7Z/qtyoABIMGpuuVY=; b=pQyLNSJRNO5L2xF28Js05cd2NAebIAud9hw/Z5TrBZuKoT7JeLeyoRu8Du7H8nbvoOAAFhrNynZEsPI23yjA+AZH9h5GqpU4ASUPt0yN/iWiAc2mdQ3mgzwn4IifUHEW44hn8nBDwYohm5ofctkENa3/YVALZyuGMMFlz6CJolMYYRj9+Y2gqQtMygWQHt2pPyUg4z7xyDS9GRm8zfQ8DFXBc30c5Mg4GCAc+GNVwjfp6ZV84ZcazkqRiXprQ396IlC/VbnZlm1PuwvsYw3ikMBzFK6UsQIWcYIFdTvtIzKRZTYyg4rHhBApyalc7HboAEVVDU3q35Tu08JgHH95WA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TY2PR06MB3520.apcprd06.prod.outlook.com (2603:1096:404:100::22) by TY0PR06MB5594.apcprd06.prod.outlook.com (2603:1096:400:32b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.29; Wed, 1 Nov 2023 04:17:29 +0000 Received: from TY2PR06MB3520.apcprd06.prod.outlook.com ([fe80::e5e:d180:d199:47af]) by TY2PR06MB3520.apcprd06.prod.outlook.com ([fe80::e5e:d180:d199:47af%6]) with mapi id 15.20.6933.024; Wed, 1 Nov 2023 04:17:29 +0000 From: Wu Bo To: linux-kernel@vger.kernel.org Cc: Alasdair Kergon , Mike Snitzer , dm-devel@lists.linux.dev, Wu Bo , Wu Bo Subject: [PATCH 1/1] dm verity: don't verity if readahead failed Date: Tue, 31 Oct 2023 22:26:10 -0600 Message-Id: <20231101042610.606136-1-bo.wu@vivo.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SG2PR04CA0191.apcprd04.prod.outlook.com (2603:1096:4:14::29) To TY2PR06MB3520.apcprd06.prod.outlook.com (2603:1096:404:100::22) Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY2PR06MB3520:EE_|TY0PR06MB5594:EE_ X-MS-Office365-Filtering-Correlation-Id: 2de90c4a-5df9-42cd-4307-08dbda9175d8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: w1FMp7nUB21ClWP0Mr+GvWawoE76sEfgQnLiNseNaWI4loIlKdwIAa6GVxkNnToPCDwbJUkm4ZXF0v9NqVb8X5rrVLzcGPdIOs6Zh5QD+g3r1r5BJZr+yptsTsU9NvKtJgFDqUYxQ+ztGolUU3J71VBAUWIdcx64+9p2Hse87vRZ71SMHo+DSXZKQUBsGxmI0udiioeXmLRn7fY4ZZakTlA4aHf+Nwmm0zlMG72Wu2GK1s/l/ivlCUS3wZWCDfM6O3wyd/mNIe67fKtYxQyWWJyDVAkUCBXHBbfq4kHlhaiMddDAVgGJOELYyTvIADWy/VEAPdLkLyv2VKSocxLQhQYveHzG+nn4iS2SpAsW2DMSfgTsoObKVql9dec4CKujrH+SfRc56wLfgVobhfzZNVJfbvR+io6I3FkKAiSLygBJagkVZmQh1Yalu7b10LwQS11NQQGuzeZ4jJajaDG+v9XWRsagvhDkICOvDv0OljeePUnLLrnNAK0lCeV4OJkALu7MfX/ZG6SgbmgpXS8KrsWZ7rhuNaJHVlfWLgl6i0SzVZ7CT1ne0stqLG/5C6YEI8o+IXrJ56E6ihVX1JpHa25uHJLmdTq40/2pjmqoOcKiduBwYFDBARJTaoDai9ij X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TY2PR06MB3520.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(39860400002)(376002)(346002)(366004)(136003)(230922051799003)(64100799003)(1800799009)(186009)(451199024)(52116002)(478600001)(6486002)(6506007)(6512007)(6666004)(2616005)(107886003)(66946007)(66556008)(66476007)(26005)(54906003)(316002)(6916009)(2906002)(86362001)(38100700002)(4326008)(1076003)(83380400001)(8676002)(38350700005)(8936002)(41300700001)(5660300002)(36756003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PzYBzm+JNiYZqowyWLEkIbeL4BFai12I2ezfcTEgDMlceN6p4QjBNRmMbq5fJ8bjH+t+EDeumpJAc9oujzstATr5qEnyF3d4D3ELVSdPUPWjZLMcZ9SVS6KVSbAkUvTAzVx0se/AJBXcajwWGI0v17UUK47m/z4m0/vUSY7ptD/KWWlqmcjMHlaNsfBzl6trHgcG+30aML5iCSv9oD/Y+Q6ItDM6trzwGLmg3UBbFke+nMn9DWaCK6fxqcJW0EPaN3PNWjnqnRC14WZsRojTcmB5IU/ytSMzW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ZBYA5cmCQVt1Mq43YDQuF9u68rcJkMDl524NoZyXSzzoa5tyB4hOyR3ej9WT20Ev/z07u0kEnWI6YutFiVOY/bLFYnoHEx8kGQXONfjVj0ycfDUwQQncfQ9mIodF2EOhptYx67EoP4unWD9jhe9Bt8weEk/8yoje3K2fmiDqlAGrGvSsRh0lrxTTXF/4TPlbIkqNTYMwW/Z74CS+uALn71X5qjOSyzRRk0lrLnruHfZlIWDQ X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2de90c4a-5df9-42cd-4307-08dbda9175d8 X-MS-Exchange-CrossTenant-AuthSource: TY2PR06MB3520.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2023 04:17:28.8305 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mSWgYGTB1VNuWhGeSnUM42/YjBfOFg5GK5/RpfdapoAD9sm46AtJETd/23qycsZrasc9N0f9xeyidtBx0yTcug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR06MB5594 If the IO is marked as readahead. When it is failed, it would better to pass it to upper layer to handle it. Consender the following situation: dm-verity is built over a dm device. 'dm_submit_bio()' will return IO error when dm device is suspended. And IO get nothing, but it will goto FEC, and trigger more IO on the suspended device. It's a vicious circle. Signed-off-by: Wu Bo --- drivers/md/dm-verity-target.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm-verity-target.c b/drivers/md/dm-verity-target.c index 26adcfea0302..253e65b4160e 100644 --- a/drivers/md/dm-verity-target.c +++ b/drivers/md/dm-verity-target.c @@ -667,7 +667,9 @@ static void verity_end_io(struct bio *bio) struct dm_verity_io *io = bio->bi_private; if (bio->bi_status && - (!verity_fec_is_enabled(io->v) || verity_is_system_shutting_down())) { + (!verity_fec_is_enabled(io->v) || + verity_is_system_shutting_down() || + (bio->bi_opf & REQ_RAHEAD))) { verity_finish_io(io, bio->bi_status); return; }