Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp674290rdb; Tue, 31 Oct 2023 21:17:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHpJITk9w1jxU7ufRf0LBMLY6Sfk7J1U1gI5pLFR1ZB5oe/IEWd+tG71KcWQmbGK8SeqGZE X-Received: by 2002:a17:902:e846:b0:1cc:703d:20fe with SMTP id t6-20020a170902e84600b001cc703d20femr2984429plg.42.1698812271025; Tue, 31 Oct 2023 21:17:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698812271; cv=pass; d=google.com; s=arc-20160816; b=AfwBFDUM9ij8gBNgawIypkd+NUILLS5hse1mTB/yIxzVNDMOfGGvhkk4AcAEewZS79 7slq3d60hnjqz9wLZxoe4aqe27dCh85UKctyiJck8CflVug+eALh5JABrbHBrRtHf0s/ R+2TvhTLmUYdMRU9nYBeVYwfzq2ov0XeEwkeOqiZMGdxv+MyO1V4Xxj4dq4rKcjRgVtw t6diUaVxg1FgKjLTAX4Cs/auc78Ndx3OqQIFaOaAIP+3J7fZlWN1eAamNvd2XPwzC4qb DiCVP5oETMSCx/cJ3pR8eNPnkoImeITH2oqcEAUwnGjnoG+NGqoXrvkOHgqgmVE+fBkk 7FYA== 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:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id j3-20020a170903028300b001b9d180fd9asi2248395plr.121.2023.10.31.21.17.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 21:17:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; 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:7 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 snail.vger.email (Postfix) with ESMTP id 1797480D6E41; Tue, 31 Oct 2023 21:17:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344628AbjKAERl (ORCPT + 99 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: =?us-ascii?Q?PzYBzm+JNiYZqowyWLEkIbeL4BFai12I2ezfcTEgDMlceN6p4QjBNRmMbq5f?= =?us-ascii?Q?J8bjH+t+EDeumpJAc9oujzstATr5qEnyF3d4D3ELVSdPUPWjZLMcZ9SVS6KV?= =?us-ascii?Q?SbAkUvTAzVx0se/AJBXcajwWGI0v17UUK47m/z4m0/vUSY7ptD/KWWlqmcjM?= =?us-ascii?Q?HlaNsfBzl6trHgcG+30aML5iCSv9oD/Y+Q6ItDM6trzwGLmg3UBbFke+nMn9?= =?us-ascii?Q?DWaCK6fxqcJW0EPaN3PNWjnqnRC14WZsRojTcmB5IU/ytSMzWVjhX8Ez8Mb4?= =?us-ascii?Q?M4+GXbefRA60mUSx7pMk3V/oZO8CvxVSs40RoEcGQOmROfsuLiooDBkH0eEx?= =?us-ascii?Q?uaAHSeYgsQX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ibWCrMVsDS+?= =?us-ascii?Q?K0u6BKH0XPTvRWyjUpEmUnu3jbgSvjmjtjv4cG1Wj9saOCVWDdTSQjrd0XAK?= =?us-ascii?Q?Nlw5t4TxBYr4WbJ4UycsrmzOajbIZIvYfufLyF6QZBYA5cmCQVt1Mq43YDQu?= =?us-ascii?Q?F9u68rcJkMDl524NoZyXSzzoa5tyB4hOyR3ej9WT20Ev/z07u0kEnWI6YutF?= =?us-ascii?Q?iVOY/bLFYnoHEx8kGQXONfjVj0ycfDUwQQncfQ9mIodF2EOhptYx67EoP4un?= =?us-ascii?Q?WD9jhe9Bt8weEk/8yoje3K2fmiDqlAGrGvSsRh0lrxTTXF/4TPlbIkqNTYMw?= =?us-ascii?Q?W/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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Tue, 31 Oct 2023 21:17:50 -0700 (PDT) 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; } -- 2.25.1