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: 160435 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp180117vqx; Tue, 31 Oct 2023 21:18:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHRPO4PEBZYmvB3GnM65upGGi3ONwaZkmn8Ea4Shfo0LOrPDHxTbOBxregFAVJ+R5Zo/CPV X-Received: by 2002:a17:902:ea0a:b0:1cc:4ae8:dadc with SMTP id s10-20020a170902ea0a00b001cc4ae8dadcmr9405422plg.64.1698812288021; Tue, 31 Oct 2023 21:18:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698812288; cv=pass; d=google.com; s=arc-20160816; b=NslMb6mq27uVDFSd2UkNW45aFr/GfaJR0guip9nIKxKKiFkOKsTzEvffQWl8SKCoOS DpYKci9ayAN0CE6BOOy1X/GTLuWIZ1QsiE795MVyK6f8FCUQlefcpMC0zLvlVGYqe73G xMX+qcmqLZFA80YLiPpWGCRHMWV/lDToGZK/O3Zwy7pw5P0WgyPc6ax0AygqDCzUZF9/ PxyEtbvp1kNG9zevUCGkFOuc+S3AZOjk5gSe36vRwCempZYzdxh8+EOv5xSiDHWmjaw5 LSkGeSx6+G59Q95cj9/w7Sur3rk5nP7wxbudoN19/gaTJDBui9Fd3xa1IJ964WovBQy6 smwg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=aKxPqIwRH/0UToZwAf5WSBo1aM7Z/qtyoABIMGpuuVY=; fh=AXfomIqT+VqkdV+WHRjpHn2GhLHitcvJ1/vNHVXx+2s=; b=r+TkD4R+o6G1Zp4/37SAhiayEGcvQmt16wwhaqgtjGZV5nxndqUd09qzCSFkJ3zM+n U+6bdgK0FZwDOmAp7xkR0z9XjMqRKLeIreouzPnQP0dt1Ri9f6ZsHu9sNRJ8pABlGduS 2JWJFN5mVHSjR8fBxEYVhILSFz3PrJQY/Z6EJKy8kczmtkQQw6QsmvQ9t8I6ZzdOtzL1 oeEgtSLD0ouwetG61V/4tIfeWh0+CdUapRBHUc1AsqHerVCSysBiA1fiDV4Xvb9UAMwb fpvjNTRtPQ9N8JmV+7DU8avPENCcAGEil+EHOwMTgd1FSANIbsaVTyGV+6l6Cgbu4MMe Qtcg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=pQyLNSJR; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id d18-20020a170903231200b001b7ea20dbf2si2203372plh.224.2023.10.31.21.18.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 21:18:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=pQyLNSJR; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 4689880C59B7; Tue, 31 Oct 2023 21:18:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344644AbjKAERl (ORCPT + 35 others); Wed, 1 Nov 2023 00:17:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344653AbjKAERj (ORCPT ); Wed, 1 Nov 2023 00:17:39 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2094.outbound.protection.outlook.com [40.107.255.94]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77D0910D for ; Tue, 31 Oct 2023 21:17:33 -0700 (PDT) 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) 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/ytSMzWVjhX8Ez8Mb4M4+GXbefRA60mUSx7pMk3V/oZO8CvxVSs40RoEcGQOmROfsuLi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ev/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 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 31 Oct 2023 21:18:03 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781333794029750360 X-GMAIL-MSGID: 1781333794029750360 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; }