From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (mail.openvz.org [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id ECA4C8017D for ; Wed, 28 Oct 2026 10:13:13 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 69SAC1rM018397; Wed, 28 Oct 2026 13:12:02 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69SAC1rM018397 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="TrngVjUK" Received: from mail-yx1-f70.google.com (mail-yx1-f70.google.com [74.125.224.70]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 69SABZsq018323 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Wed, 28 Oct 2026 13:11:35 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 69SABZsq018323 Received: by mail-yx1-f70.google.com with SMTP id 956f58d0204a3-6768601940bso3607467d50.1 for ; Wed, 28 Oct 2026 03:11:35 -0700 (PDT) X-Gm-Message-State: AFq9FYLnzksNpleX/kcFbXuhV5rs5EpmegQJKX3Vgb8BQRoMC9ddGZN5 Pt9hxMEOY41RD5ekgB1QkLkc+266oeJvkdYkMjdsjODVUXGFVdpo2PljdPY0bc4355l/CgrVTFT cjcriDQYJyOms3ygUxh9vJAx8g1tRb9ynnEwT5ibkld+CVcsYxh1Xsg== X-Gm-Gg: AYBFou17JrURK8s7rwPZwzoAK45t+MOHqeOwJOH7JgCG0T9ACjypbSLHd2NIGngX6e/ 73CStIbGWhs7k7A16nU3B8fbZ5q3wMj8WuMOJIqHOP0VqI/CV3GscfK79eYAU1DSsuP/a7e5uUp LQQX1LBQGboGapxOaBtBP/KQ0q0FGiFfjMGN1WbWUVLP87nEantMfze6KqMIWPhFO0DPMtubTlE nWbOMNihXmGuxhEJ3kAy8IBH62UPK8GeTGeAgdVcUcbhA7RRVcCsquIj+PTY596vu10x9DS82dd J30yG8W0ZTcb2yTdt/B4vePxPp9GvkmgcXiLNRsvo+/o95xcZKgMQaQLWDLtB8w9cwqaW+Z6Vwc FD5eV8hrCKzbgc6AwMosa5yskObBUTQaw3zg8OwQUwmqrEY50KNNLMs4G0DoaNbLJIrA2chvR0y m61w0uvtS/j4k6XFzMnLQekqdOud1H X-Received: by 2002:a05:690e:4504:10b0:679:a1f6:2ea0 with SMTP id 956f58d0204a3-67a814c19c1mr508630d50.33.1793182294755; Wed, 28 Oct 2026 03:11:34 -0700 (PDT) X-Received: by 2002:a05:690e:4504:10b0:679:a1f6:2ea0 with SMTP id 956f58d0204a3-67a814c19c1mr508624d50.33.1793182294142; Wed, 28 Oct 2026 03:11:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1793182294; cv=pass; d=google.com; s=arc-20260327; b=UDNesKN9j7UwBJNLBzKOGCHXBs2IIWFi+ExrsVPVWyX7lH18m/V23RlE7Lce9SMKFJ EMXkR0FyiDvEIR57Z0M4Bk4i4F+dG9FU3cX6bV9s2gKf5YfV0sD+nywzmp0QuUtN9ZOD W16EJ9VFmEmjZRs0lko27pgPRUMcrJmsC7IUSqMJGolrGJnTKe5VfulCwu92TyA4ubfM cCWdvJCUWHlpretBmNMwRqvHsEqC8801flAsfqAFlSELIwJtTPlg4npzi99lQgJUNqKF vyY9aOB5GQXeIeq30ZNecsv4WtdA1er+sdDPbhO+xDKyxE9Gdi9vMnRQeqiSdUXp+IaK eEtQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=mime-version:cc:to:in-reply-to:references:message-id :content-transfer-encoding:subject:date:from:dkim-signature; bh=D7Hhe/De5FLAouqu9F5tAt4adXwC7Ysuz+DA9Ee/hVE=; fh=y3TfVeQA9QYtIzD5Inxiyys5ebBfyOgjQPZaP/+mSiI=; b=R5bHuuFO9AXe7u+KSZmlmLObBS+2MCpczI5ihQE1rL60Ye1Qe++Zy8jz+dUi/BVeLA yiPaWHJdulJu0+mefNSCaa/OvOlBwarxX1Me+0sGTqv7BhL0wF26/AGV+1gCRmCP/obk 0Gn6VnHDfIZrF3OoVExFCm3tWjzRXMZghRadodfWzkqgWLQ47Q/OD4d3JfHKIF0dejtk W+TGKYbPnIPq5h4sk3Q540waBWTwYPgcv0Fj3rK9TDUtI/Py71V+y2XI5b5Ig+eI6kKB I5JtJnYaMvb9uP/lasVSehJvM+jNVODpaMpmCjB0wDCw/pBIHBrqsWoP2fVvmGjtb6+j uaPA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector2 header.b=TrngVjUK; arc=pass (i=1 spf=pass spfdomain=virtuozzo.com dkim=pass dkdomain=virtuozzo.com dmarc=pass fromdomain=virtuozzo.com); spf=pass (google.com: domain of ptikhomirov@virtuozzo.com designates 2a01:111:f403:c200::1 as permitted sender) smtp.mailfrom=ptikhomirov@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazlp170100001.outbound.protection.outlook.com. [2a01:111:f403:c200::1]) by mx.google.com with ESMTPS id 956f58d0204a3-67a7a146ecdsi2182507d50.241.2026.10.28.03.11.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2026 03:11:34 -0700 (PDT) Received-SPF: pass (google.com: domain of ptikhomirov@virtuozzo.com designates 2a01:111:f403:c200::1 as permitted sender) client-ip=2a01:111:f403:c200::1; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector2 header.b=TrngVjUK; arc=pass (i=1 spf=pass spfdomain=virtuozzo.com dkim=pass dkdomain=virtuozzo.com dmarc=pass fromdomain=virtuozzo.com); spf=pass (google.com: domain of ptikhomirov@virtuozzo.com designates 2a01:111:f403:c200::1 as permitted sender) smtp.mailfrom=ptikhomirov@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aUBq82zAlIIKY8lM0ag/ORZCvuU7OoZbgsCZTQeUwpYS2EqT4VIeqjCqwuK9yxuEEgjk9MbCP89a4GcDgLIVWXptzvhC7mzrEocXEk7PCVwuzo5x7xbei9Np42PKR+8V+KHAoHIVkStBgnHQT1c6ZNO/7w0rqQgzzBar/V0/TwnK+9fGKxzznb5hZUU2OHLaSDeXdacQ8hqRbip0VcPC2aMuzFYxvews5v6mmnWPgLuINxgiEAzk6TwFXW7CcERneiz1BjaP4Iu/b3+QT72JoJrIFWs0y1YE9UGPQECh5MlZdAZE0yrLjm+o8NrjqbhY+6f+QqTIVsZ1fiA8BxIHgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=D7Hhe/De5FLAouqu9F5tAt4adXwC7Ysuz+DA9Ee/hVE=; b=Dyo6aT99zOwJKDohixdD3vir79sbfQrLITc3/ZYvWdqFsgZeNlNZdtJuV6sGvZ/iP5TjulI6+IXuUFGlCGo/S50JuFEaCB3/CO70iREtwz0hyFHDbeNvDxMcAtzJf3adeNQlWUQNGYoS731qbO1P+bigiHP6XPdlE6X44U4Cg07LI+HxPJHB72Lcr9hDN1fUvCCUp2TGySgJijlttbMsBfv8ae/Tu5HN/bHssmDnhYmXHr6Y1n11oDyQ03RBmKgLwEmn80i9NvdXfMbi8hwUTvFjSgdWVxTXxgEfKjVafPcIteoek4f3UhGzDEnupDaLSDtyc48teJLEH42UYBlDmw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=D7Hhe/De5FLAouqu9F5tAt4adXwC7Ysuz+DA9Ee/hVE=; b=TrngVjUKbhUAtP/P0MXO/re0/IWMKr9YksPY0aXcDphOaMpaTnhwxq88rdrJhl3NJU2agrQiC0Itm78DnJTD/nxHDlBhqezwMrdWF6qtsWRuMjRTp3nx0MVKFvpmBbeaKsvIFEenqI+jn3QWSUTSFkAruD7iK/dQjKL7hpFSMumWCLHYdF5o/Ji/sHPoNKi4AcAH2miBXOol78JybMFfg1O23H8SAicKWDhmk7lnU/TRdvNdc6Zz+XSFSoMflpC9AFYA92IvdPyt6P4/CRVORisprRZn/6NqlQfY+YHHTsCxOeQL9TTZktEulMH/rlVOyGDMFI06jaNfs2yOQEF7ZA== Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=virtuozzo.com; Received: from AM0PR08MB11804.eurprd08.prod.outlook.com (2603:10a6:20b:747::14) by AS8PR08MB8802.eurprd08.prod.outlook.com (2603:10a6:20b:5bc::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.569.8; Wed, 28 Oct 2026 10:11:28 +0000 Received: from AM0PR08MB11804.eurprd08.prod.outlook.com ([fe80::bf46:f137:f6d2:5b3a]) by AM0PR08MB11804.eurprd08.prod.outlook.com ([fe80::bf46:f137:f6d2:5b3a%7]) with mapi id 15.21.0569.007; Wed, 28 Oct 2026 10:11:28 +0000 From: Pavel Tikhomirov Date: Wed, 28 Oct 2026 11:11:28 +0100 Message-Id: <20261028-ptikhomirov-vstor-149268-cbt-account-at-rq-start-v7-7-5c48672191c2@virtuozzo.com> References: <20261028-ptikhomirov-vstor-149268-cbt-account-at-rq-start-v7-0-5c48672191c2@virtuozzo.com> In-Reply-To: <20261028-ptikhomirov-vstor-149268-cbt-account-at-rq-start-v7-0-5c48672191c2@virtuozzo.com> To: Konstantin Khorenko X-Mailer: b4 0.16.0 X-ClientProxiedBy: BE1P281CA0336.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:7d::15) To AM0PR08MB11804.eurprd08.prod.outlook.com (2603:10a6:20b:747::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR08MB11804:EE_|AS8PR08MB8802:EE_ X-MS-Office365-Filtering-Correlation-Id: 8478f80a-46e8-4f2a-537d-08df34dbd4c9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|23010399003|366016|376014|52116014|10070799003|1800799024|18002099003|22082099003|56012099006|261026121527099003|261026140227099003|10067099003|261021121427099003|261021123027099003|261009223027099003|261022105027099003; X-Microsoft-Antispam-Message-Info: +3DsNizoDh3OSDfsBqEAdp+087NqBiThTRLFLJWy22FWURO9zgR+3fXh1kEVK255j+VGyuh+0inp/wwF9QIq25xWXRMs0JdFHy6Lnw+Ee80CpJyYNz9LDbngI2ontbjRUqqR0YdbzD7i1BaCnvFwi3aQZSsl7f/iQOWEUBmfwzrMMbSJKavVjzoBkn760fI4FvZzcnIDXvXEHzLSrERixN1BgGwldbTk3kxUdYk368SMyKjieY1b3kJQ+ixyoHxMrZZZ54H3gYswISscQ+Ex8vEBz1kuZpTb+D2EO4eTpX5iCEbmRGWy3KYaKkCWYVKpvIAaNZrFKsMLbtNTJ9NYFXjED32hG6FQULWPNS+k91g40UL0cdT7ceisKxBCDjWDgMstT0QbaOPlHlVlzDrYTdKtQqNhiyJIZusgwkfQrzuXMFwBsMv0LHhTCB/NJo1eZHqdWJDbn/ZUmNEH9Kn+ZasSnUiu8sQGz7jmWyT5zuLzhC7/8CU0RF/OGfCZF10IlI/Dhi9WJNKQ/6RK3RqscVMtm4OMCMYBrdQzjbFpKv1RF33Vey7zSn2E3yPcYcPsFhDgSdXKrAHhZDTrXYIguUfbyLWyLgIC4VrIsfMO2W0uT6xs6kIzEZbzmWqBBulG X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR08MB11804.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(23010399003)(366016)(376014)(52116014)(10070799003)(1800799024)(18002099003)(22082099003)(56012099006)(261026121527099003)(261026140227099003)(10067099003)(261021121427099003)(261021123027099003)(261009223027099003)(261022105027099003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZE5RTWhMVGpLUzdjLzg5bG1TMkk3WkExWG9ZQ3ZDM3hsQisxSURzSFNBZWZt?= =?utf-8?B?b292ODVOQ1Z5eSsvZFZ6eUhoRVk2T1NEQUNZK0JaaFA0RXIrQnIyWmIzUkpv?= =?utf-8?B?ZGRRRVlKaHhHM0Z6anV5dWt0NHVPSVlod2xkMDlBTFZxd3lXenpXYTgvTm5u?= =?utf-8?B?WE9vTWMyZUNuSStoMFRjTTMvcm9MdDNmRHhkMWpkSHUyTXlYSDNrOFFoVytC?= =?utf-8?B?RlA0NlVkMGRpMG1JVXhCQ2s1clF3YVp2a3NCS2dLRzRsajBiUFJuMGcwOE0z?= =?utf-8?B?bDd2cmx0WUFZelhIUk5BN3R1WEl4WUJDVXZaMElkMXNpV0pBR1R0dGg0UWRh?= =?utf-8?B?cmtnemVpK1RsNWU1UEVWSWpvMVpiWm55MVZKdjN3b0duUFVTUjBtVG4rZnhE?= =?utf-8?B?R0NWZjlmM3IrbU4wdUpYUVo3MnBpUnRVYkdyTUlXTnd5WXVJTWtSV2ZKVEVC?= =?utf-8?B?bWZ2QnhpWHJuZ2p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1YyV2Uy?= =?utf-8?B?ejNtMGtMVC9kZ3J3MkVSSGpnR1FNVVBiZWdxQ0tHSk80a0xZMjNXYkV2a3FX?= =?utf-8?Q?h+8sCmk4Z4yyTZOjHOADnz9CnpxNsIsBT2bc7ICd31h8p?= X-MS-Exchange-AntiSpam-MessageData-1: LALaD5QsKJ03mX30aip92nC8GKeBV4t2f6c= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8478f80a-46e8-4f2a-537d-08df34dbd4c9 X-MS-Exchange-CrossTenant-AuthSource: AM0PR08MB11804.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2026 10:11:28.2930 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qW4h+YpJgWa8KRZPQpee04Es4e3ejH2uuktMvgeUmeV2ztSDgWtWen+z7vx2K5zT0znQHjiJrOC/ORrZG4HAMe8fyQXYpumgXaMUavpVXwg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8802 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 v7 7/8] block/blk-cbt: don't sleep in CBT for a REQ_NOWAIT write X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org Accounting a write in CBT may allocate a bitmap page with GFP_NOIO, either for the write itself or for the extent it evicts from the per-cpu cache, so a REQ_NOWAIT bio can sleep in submit_bio_noacct(). For a REQ_NOWAIT write, skip the cache and set the bits directly, which doesn't allocate when all the pages are there. If one is missing, fail the bio with BLK_STS_AGAIN, for the submitter to retry it in a context that may block. The throttle dispatch work may sleep, so it doesn't use this. https://virtuozzo.atlassian.net/browse/VSTOR-149268 Feature: cbt: changed block tracking (for backup) Signed-off-by: Pavel Tikhomirov --- block/blk-cbt.c | 57 +++++++++++++++++++++++++++++++++++++++++++------- block/blk-core.c | 5 ++++- block/blk-throttle.c | 2 +- include/linux/blkdev.h | 7 +++++-- 4 files changed, 59 insertions(+), 12 deletions(-) diff --git a/block/blk-cbt.c b/block/blk-cbt.c index 3ad4b9a25e1f4..7b6441fad08f9 100644 --- a/block/blk-cbt.c +++ b/block/blk-cbt.c @@ -231,26 +231,55 @@ static int __blk_cbt_set(struct cbt_info *cbt, blkcnt_t block, return (pages_missed && *pages_missed) ? -EAGAIN : 0; } -static void blk_cbt_add(struct cbt_info *cbt, blkcnt_t start, blkcnt_t len) +/* + * Return true if all the map pages for [block, block + count) are there, + * or for an empty or out of range request, which needs no page. + */ +static bool cbt_pages_present(struct cbt_info *cbt, blkcnt_t block, + blkcnt_t count) +{ + unsigned long idx, last; + + if (unlikely(!count || block + count > cbt->block_max)) + return true; + + last = (block + count - 1) / BITS_PER_PAGE; + for (idx = block / BITS_PER_PAGE; idx <= last; idx++) + if (!CBT_PAGE(cbt, idx)) + return false; + + return true; +} + +/* Return true if nowait and a bitmap page is missing */ +static bool blk_cbt_add(struct cbt_info *cbt, blkcnt_t start, blkcnt_t len, + bool nowait) { struct cbt_extent *ex; struct cbt_extent old; blkcnt_t end; if (unlikely(test_bit(CBT_ERROR, &cbt->flags))) - return; + return false; end = DIV_ROUND_UP(start + len, 1UL << cbt->block_bits); start >>= cbt->block_bits; len = end - start; + if (unlikely(nowait)) { + /* Don't sleep: set the bits directly, only with all pages there */ + if (!cbt_pages_present(cbt, start, len)) + return true; + __blk_cbt_set(cbt, start, len, 1, NULL, NULL); + return false; + } if (unlikely(test_bit(CBT_NOCACHE, &cbt->flags))) { __blk_cbt_set(cbt, start, len, 1, NULL, NULL); - return; + return false; } ex = get_cpu_ptr(cbt->cache); if (ex->start + ex->len == start) { ex->len += len; put_cpu_ptr(cbt->cache); - return; + return false; } old = *ex; ex->start = start; @@ -259,21 +288,33 @@ static void blk_cbt_add(struct cbt_info *cbt, blkcnt_t start, blkcnt_t len) if (likely(old.len)) __blk_cbt_set(cbt, old.start, old.len, 1, NULL, NULL); + return false; } -void blk_cbt_bio_queue(struct request_queue *q, struct bio *bio) +/* + * Account a write in CBT. With nowait, don't sleep: return true if a bitmap + * page is missing, for the caller to fail the bio with BLK_STS_AGAIN. + */ +bool blk_cbt_bio_queue(struct request_queue *q, struct bio *bio, bool nowait) { struct cbt_info *cbt; + bool wouldblock = false; int idx; if (list_empty(&q->cbt_list) || bio_data_dir(bio) == READ || !bio->bi_iter.bi_size) - return; + return false; idx = srcu_read_lock(&cbt_srcu); list_for_each_entry_srcu(cbt, &q->cbt_list, list, - srcu_read_lock_held(&cbt_srcu)) - blk_cbt_add(cbt, bio->bi_iter.bi_sector << 9, bio->bi_iter.bi_size); + srcu_read_lock_held(&cbt_srcu)) { + if (blk_cbt_add(cbt, bio->bi_iter.bi_sector << 9, + bio->bi_iter.bi_size, nowait)) { + wouldblock = true; + break; + } + } srcu_read_unlock(&cbt_srcu, idx); + return wouldblock; } static struct cbt_info *do_cbt_alloc(struct request_queue *q, __u8 *name, diff --git a/block/blk-core.c b/block/blk-core.c index bcc3060de670c..6bc78f7c23d38 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -871,7 +871,10 @@ void submit_bio_noacct(struct bio *bio) if (blk_throtl_bio(bio)) return; - blk_cbt_bio_queue(q, bio); + if (blk_cbt_bio_queue(q, bio, bio->bi_opf & REQ_NOWAIT)) { + bio_wouldblock_error(bio); + return; + } submit_bio_noacct_nocheck(bio); return; diff --git a/block/blk-throttle.c b/block/blk-throttle.c index e1e008a30bf2c..00f0db0a57f8d 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -1225,7 +1225,7 @@ static void blk_throtl_dispatch_work_fn(struct work_struct *work) blk_start_plug(&plug); while ((bio = bio_list_pop(&bio_list_on_stack))) { /* submit_bio_noacct() did not account it in CBT */ - blk_cbt_bio_queue(q, bio); + blk_cbt_bio_queue(q, bio, false); submit_bio_noacct_nocheck(bio); } blk_finish_plug(&plug); diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 1284bb0e4ebc0..885555f480462 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1626,7 +1626,8 @@ static inline bool blk_crypto_register(struct blk_crypto_profile *profile, #if defined (CONFIG_BLK_DEV_CBT) extern void blk_cbt_update_size(struct block_device *bdev); extern void blk_cbt_release(struct request_queue *q); -extern void blk_cbt_bio_queue(struct request_queue *q, struct bio *bio); +extern bool blk_cbt_bio_queue(struct request_queue *q, struct bio *bio, + bool nowait); extern int blk_cbt_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg); #else /* CONFIG_BLK_DEV_CBT */ static inline void blk_cbt_update_size(struct block_device *bdev) @@ -1635,8 +1636,10 @@ static inline void blk_cbt_update_size(struct block_device *bdev) static inline void blk_cbt_release(struct request_queue *q) { } -static inline void blk_cbt_bio_queue(struct request_queue *q, struct bio *bio) +static inline bool blk_cbt_bio_queue(struct request_queue *q, struct bio *bio, + bool nowait) { + return false; } static inline int blk_cbt_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg) -- 2.55.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel