Message ID | 20200914104338.17727-1-aryabinin@virtuozzo.com |
---|---|
State | New |
Series | "Series without cover letter" |
Headers | show
Delivered-To: criupatchwork@gmail.com Received: from imap.gmail.com [74.125.140.109] by patchwork.criu.org with IMAP (fetchmail-6.3.26) for <root@localhost> (single-drop); Mon, 14 Sep 2020 12:45:10 +0200 (CEST) Received: by 2002:a6b:dd16:0:0:0:0:0 with SMTP id f22csp1767403ioc; Mon, 14 Sep 2020 03:45:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBRrPpJxdn8ev17VPYSwzkNxjyzdBwFBFhzjkOsaCTL44c5i0sxtmhnaVzAIP+dBoTbpBl X-Received: by 2002:a19:84ca:: with SMTP id g193mr4575712lfd.85.1600080307209; Mon, 14 Sep 2020 03:45:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600080307; cv=none; d=google.com; s=arc-20160816; b=fHxQwWmpeb1X3LxO2lzh4Cz2/+LQqJ7ca1m7hcaqM0E4+3XNrKKBB7NcM66+HREfFu 4WBsubCkdoLmV3c/jIIgMLC/tBZP4zsu+Shh5muTKRf+P7m3K0AfseH9uT774mSs7TAS 0MpFEWlpWRmVSjMnEp6/sfqv9Sq2n3zH35RJkH1FSbltVVhJAOzMwLtmv5VPSuW2lTmu hfez6++f+X4zZtTli8leBlGFhSOP2qXloIC8mBoRT/bXpeC+2M/DdZhd39m5kKSwA3wt jy8ntSfPrbrz/W5LaAWpyIuz0lUdoaWO/XPybo1VlSWfsU3yo2sKqdF5MT4oVp3SKS45 naqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from; bh=kPTr5uv0+oE9+lHVJsXhq5GHzn8/LlxXxFq5xBglbRc=; b=nsEsUhWZSHmcKK0yXaLLI6D6XJYlNaZ7FvbEaP7mO5fjRzjNl39vKdIvzwNtXxs4B/ 0j44JFZmfyh8xQQSpG3TGwJtK2fehVleWpA4A5I5DRwfW1iVxgnPPDVAX1l0kmHdN7ny jlsgZmB82N5CsO7uZ8cTHSK3r1PBRWyp9E3B7in9GNwbbfu+zu4sl5wUCENcXyaZv1gL cLRosQ6uSSUbFumgsqqaq/A0mJaM/3C67TrbGaKJnVMXTihizT2NCvs80aqCjb54inkW Ryw0lMGNrIkZvaFjv6XA+QpnStAjQzTKEK+Y90zgKEBTtndAfH7UgOzqT2KqV1+Yzi9w Nv/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of devel-bounces@openvz.org designates 185.231.241.50 as permitted sender) smtp.mailfrom=devel-bounces@openvz.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Return-Path: <devel-bounces@openvz.org> Received: from mail.openvz.org (mail.openvz.org. [185.231.241.50]) by mx.google.com with ESMTPS id f4si4134079ljo.489.2020.09.14.03.45.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Sep 2020 03:45:07 -0700 (PDT) Received-SPF: pass (google.com: domain of devel-bounces@openvz.org designates 185.231.241.50 as permitted sender) client-ip=185.231.241.50; Authentication-Results: mx.google.com; spf=pass (google.com: domain of devel-bounces@openvz.org designates 185.231.241.50 as permitted sender) smtp.mailfrom=devel-bounces@openvz.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from localhost.localdomain (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 08EAiXkT001748; Mon, 14 Sep 2020 13:44:43 +0300 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04lp2059.outbound.protection.outlook.com [104.47.12.59]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 08EAiU9X001745 for <devel@openvz.org>; Mon, 14 Sep 2020 13:44:30 +0300 Received: from DB6PR0301CA0015.eurprd03.prod.outlook.com (2603:10a6:4:3e::25) by VI1PR0802MB2319.eurprd08.prod.outlook.com (2603:10a6:800:a0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.17; Mon, 14 Sep 2020 10:44:23 +0000 Received: from DB5EUR01FT030.eop-EUR01.prod.protection.outlook.com (2603:10a6:4:3e:cafe::93) by DB6PR0301CA0015.outlook.office365.com (2603:10a6:4:3e::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16 via Frontend Transport; Mon, 14 Sep 2020 10:44:23 +0000 Authentication-Results: spf=pass (sender IP is 185.231.240.75) smtp.mailfrom=virtuozzo.com; openvz.org; dkim=none (message not signed) header.d=none; openvz.org; dmarc=pass action=none header.from=virtuozzo.com; Received-SPF: Pass (protection.outlook.com: domain of virtuozzo.com designates 185.231.240.75 as permitted sender) receiver=protection.outlook.com; client-ip=185.231.240.75; helo=relay3.sw.ru; Received: from relay3.sw.ru (185.231.240.75) by DB5EUR01FT030.mail.protection.outlook.com (10.152.4.254) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16 via Frontend Transport; Mon, 14 Sep 2020 10:44:23 +0000 Received: from [192.168.15.154] (helo=localhost.sw.ru) by relay3.sw.ru with esmtp (Exim 4.94) (envelope-from <aryabinin@virtuozzo.com>) id 1kHlxG-003T50-Hd; Mon, 14 Sep 2020 13:43:26 +0300 From: Andrey Ryabinin <aryabinin@virtuozzo.com> To: devel@openvz.org Date: Mon, 14 Sep 2020 13:43:35 +0300 Message-Id: <20200914104338.17727-1-aryabinin@virtuozzo.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 57c9ceb1-ac4a-4945-b881-08d8589b24e3 X-MS-TrafficTypeDiagnostic: VI1PR0802MB2319: X-Forefront-Antispam-Report: CIP:185.231.240.75; CTRY:RU; LANG:en; SCL:-1; SRV:; IPV:CAL; SFV:SKN; H:relay3.sw.ru; PTR:relay.sw.ru; CAT:NONE; SFS:; DIR:INB; X-MS-Oob-TLC-OOBClassifiers: OLM:1051; X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?iAFREOxoJZeJXbk1QUetTrdUVTg7VfhymEJBh0lSy+tty7s0QeQ1TAqSJZs1?= =?us-ascii?Q?6U2TDST7/Z2OD5HNpOTZ+OIKN/kgJ0OquREAHl/Itn3uy7JMfV4Df8XLmgZi?= =?us-ascii?Q?DZeabhIcPYpeP/EoMfWMR0vP7P6vqZxQThBahMUHxwO4R1DkBegrocs9SqnD?= =?us-ascii?Q?VgjM4yTWCnkA1tAlRwLRUPd36aRUotrwm2gAxqcCFIpJedosIm2jyM/jMKn0?= =?us-ascii?Q?61Vs2UaDk5m8vQ8ogRGLWLApGKjl4Ops7V2JYl5b+mijnYPN6tbHbRUA0tvc?= =?us-ascii?Q?H84mRsnkl88utUE5We7ecj9etMAidsJFRvHSgcCrUHHFKHtZPKMx2x5M+9x+?= =?us-ascii?Q?T5+WmNDYB43wQS3uPh06hroVnXwksfjh+Nu0yEvuf9D3nUuriVV74YaVGfty?= =?us-ascii?Q?2lCQ5L1SOuW7VUjxzsG7RQN1VymMnlWpTnLZgK7gmuJ7dLPKMshMDK2Iy5Nx?= =?us-ascii?Q?bhzGD1YyeHpvsoSrG3TampUL/Ie5hlxIik18ofvFjepTaeda+EFxoofgd5U8?= =?us-ascii?Q?OlOKHRA4y9MmKkIHAV/GpUBUx1AKv4JFdZhmSn4DoGuRh2eGrHG2+4LZHY7M?= =?us-ascii?Q?a2iBn60ej13mi5+qU11GbQBihq8Pws1s7vgdT9p0ajPnVQr8rKwgtjZvoPkK?= =?us-ascii?Q?QWAejqxyU4MPXlFcgqOmYbc3tWdv5ABzm8BgVlepD761f9s5OIWTR2hKuwOS?= =?us-ascii?Q?FHqCQ+Hm9CpxO69IkOveJr6rd9qorEWE7X61zGiYmvnyBejlE0cVtyBnNoRb?= =?us-ascii?Q?jWz/gdVgqOQO5EloUm1yCFBmHzB9z4iDMESgIQcw8tJRja9ksDXnAYLU0YLl?= =?us-ascii?Q?C64nhP1JuUpoKEGewvIf6eEcWJ3EgQNrUtppkdEPphjwaBNL2ae35ByGu6Of?= =?us-ascii?Q?YgCCnrDh+ynuc3Bhvd3LnsnM/OImkeAHfbRik3sMcDKNf1AmNU0trZ4e5h8g?= =?us-ascii?Q?Yi6qEUfAg3PZRVG2LYmfGDfDdPbX8QgBjzMpxB/d44V42L6ySP/EEZaPil0G?= =?us-ascii?Q?8WcmZIVhZmr6QOM5aZsGN2BUK0cmvWv4SJp7R073utHT9Fefcl1X6Pr48keS?= =?us-ascii?Q?X2WSgUqDzcWnPYTmsjEoEXzCXW6TfAtbGEh5NohAP5muAVGDOJQZ2SbVYJMx?= =?us-ascii?Q?1GS/CNnbaDInrPRa3m5L/x87kStVVjtdKF0NyRfjqx9cmP9xyi8o/fA90tog?= =?us-ascii?Q?iYIBacaGfa/tUcz3?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2020 10:44:23.4984 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 57c9ceb1-ac4a-4945-b881-08d8589b24e3 X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0bc7f26d-0264-416e-a6fc-8352af79c58f; Ip=[185.231.240.75]; Helo=[relay3.sw.ru] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR01FT030.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2319 X-MS-Exchange-CrossPremises-OriginalClientIPAddress: 185.231.240.75 X-MS-Exchange-CrossPremises-TransportTrafficType: Email X-MS-Exchange-CrossPremises-AuthSource: DB5EUR01FT030.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossPremises-AuthAs: Anonymous X-MS-Exchange-CrossPremises-SCL: -1 X-MS-Exchange-CrossPremises-Processed-By-Journaling: Journal Agent X-OrganizationHeadersPreserved: VI1PR0802MB2319.eurprd08.prod.outlook.com Subject: [Devel] [PATCH 1/4] bcache: Fix crashes of bcache used with raid1 X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development <devel.openvz.org> List-Unsubscribe: <https://lists.openvz.org/mailman/options/devel>, <mailto:devel-request@openvz.org?subject=unsubscribe> List-Archive: <http://lists.openvz.org/pipermail/devel/> List-Post: <mailto:devel@openvz.org> List-Help: <mailto:devel-request@openvz.org?subject=help> List-Subscribe: <https://lists.openvz.org/mailman/listinfo/devel>, <mailto:devel-request@openvz.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org |
diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c index 841f0490d4ef..c2bda701bf9d 100644 --- a/drivers/md/bcache/writeback.c +++ b/drivers/md/bcache/writeback.c @@ -17,6 +17,7 @@ static void read_dirty(struct closure *); struct dirty_io { struct closure cl; struct cached_dev *dc; + struct bio_aux bio_aux; struct bio bio; }; @@ -122,6 +123,7 @@ static void dirty_init(struct keybuf_key *w) bio->bi_max_vecs = DIV_ROUND_UP(KEY_SIZE(&w->key), PAGE_SECTORS); bio->bi_private = w; bio->bi_io_vec = bio->bi_inline_vecs; + bio_init_aux(&io->bio, &io->bio_aux); bch_bio_map(bio, NULL); }
When bcache is built on top of raid1 devices, the following warning happens: WARNING: CPU: 2 PID: 8138 at include/linux/bio.h:559 raid1_write_request+0x994/0xba0 [raid1] Call Trace: dump_stack+0x19/0x1b __warn+0xd8/0x100 warn_slowpath_null+0x1d/0x20 raid1_write_request+0x994/0xba0 [raid1] raid1_make_request+0x8a/0x5b0 [raid1] md_handle_request+0xd0/0x150 md_make_request+0x79/0x190 generic_make_request+0x147/0x380 bch_generic_make_request_hack+0x2a/0xc0 [bcache] bch_generic_make_request+0x3d/0x190 [bcache] write_dirty+0x7e/0x110 [bcache] process_one_work+0x185/0x440 worker_thread+0x126/0x3c0 kthread+0xd1/0xe0 ret_from_fork_nospec_begin+0x21/0x21 And immediately followed by the crash: kernel BUG at drivers/md/bcache/closure.c:53! Call Trace: dirty_endio+0x28/0x30 [bcache] bio_endio+0x8c/0x130 call_bio_endio+0x2f/0x40 [raid1] raid_end_bio_io+0x2e/0x90 [raid1] r1_bio_write_done+0x35/0x50 [raid1] raid1_end_write_request+0x118/0x2f0 [raid1] bio_endio+0x8c/0x130 blk_update_request+0x90/0x370 blk_mq_end_request+0x1a/0x90 virtblk_request_done+0x3f/0x70 [virtio_blk] __blk_mq_complete_request_remote+0x19/0x20 flush_smp_call_function_queue+0x63/0x130 generic_smp_call_function_single_interrupt+0x13/0x30 smp_call_function_single_interrupt+0x2d/0x40 call_function_single_interrupt+0x16a/0x170 So this happens because bcache doesn't allocate & initialize 'bio_aux' structure needed by raid1 device. Add 'bio_aux' to 'dirty_io' struct and initialize it along with the 'bio' in dirty_init() to fix this. https://jira.sw.ru/browse/PSBM-106785 Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com> --- drivers/md/bcache/writeback.c | 2 ++ 1 file changed, 2 insertions(+)