Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2991163imm; Sun, 1 Jul 2018 09:51:54 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL1vgI147M53dKc1OAdeclfUcXx/U0ZXwvOdve234/0wMb6x94sN0mpC/LGvN75ZgQ2pRBn X-Received: by 2002:a17:902:b590:: with SMTP id a16-v6mr23266829pls.225.1530463913958; Sun, 01 Jul 2018 09:51:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530463913; cv=none; d=google.com; s=arc-20160816; b=d1ChkhOq+ab6732h8aVdf0waTGhs2kuKCXnfye6ePpxJ5y5MSsv+T0aGqb94SvPMJS oxSPCqjJEFVercPS9CuymqkEQ35akb2be46CE7pffeqaB3Wjt73zdmFx3Mw3k8EC1QNj sozzsv46JGZXDbbwJFKdM96XA+9vLo+Basvn3k2aiwzumLq4NmF/LrDXmH3UjpPOtvIh PLlIy9NizikPPDATG+XSfcBc/urutpU95u0oQdtFCRxay6sQVCsqXgvs2XTQFEidVtue 3oU2rT2saOrfIDqqqGwI9qjolH5L1FmbS5MKRSolGbA0fk+mpB0kmA5auIbjJ1uVv8TF qZvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=FphjVOSDfSCVW1tpSv+mjU2YcH5ccNYKqVWhE1y4dN0=; b=WWxXpPSh2yX2Voo9ViUxSQX0M7TrGPoECy7Ko7AyydijZbRRk7E0a0WcuwGwF1b4R9 9p6toj5Yoz9EVxEIwLMxyOHx764jg0smaLmFEY/ydqirXVNKAyfQfsEC2RzMeDIuFIik sBk69Lj1Q9ydgLZ69NlVqRv6M2v4aJfotyxSsDBIrCQj5ESgaNGA3lS0niA5K703xikH NaOui9MIl+TiPYHNaGz1evIGA4ypLwyKetAFRp9P0gMURysJPcqg65NKwctFwjRKxJOc 8/oJaL0amsN3icoVC8ZBJeEjtBr+cIcqtTaHdLwA1lGurYzefNFxN7EUQyZcTfEsnNzw 4NCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p18-v6si14139960pfe.150.2018.07.01.09.51.39; Sun, 01 Jul 2018 09:51:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753620AbeGAQqc (ORCPT + 99 others); Sun, 1 Jul 2018 12:46:32 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:38432 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032475AbeGAQq1 (ORCPT ); Sun, 1 Jul 2018 12:46:27 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 713F5AA6; Sun, 1 Jul 2018 16:46:26 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ming Lei , Christoph Hellwig , Mike Snitzer , Bart Van Assche , Hannes Reinecke , Johannes Thumshirn , Jens Axboe Subject: [PATCH 4.17 213/220] block: Fix cloning of requests with a special payload Date: Sun, 1 Jul 2018 18:23:57 +0200 Message-Id: <20180701160917.051703066@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160908.272447118@linuxfoundation.org> References: <20180701160908.272447118@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bart Van Assche commit 297ba57dcdec7ea37e702bcf1a577ac32a034e21 upstream. This patch avoids that removing a path controlled by the dm-mpath driver while mkfs is running triggers the following kernel bug: kernel BUG at block/blk-core.c:3347! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 20 PID: 24369 Comm: mkfs.ext4 Not tainted 4.18.0-rc1-dbg+ #2 RIP: 0010:blk_end_request_all+0x68/0x70 Call Trace: dm_softirq_done+0x326/0x3d0 [dm_mod] blk_done_softirq+0x19b/0x1e0 __do_softirq+0x128/0x60d irq_exit+0x100/0x110 smp_call_function_single_interrupt+0x90/0x330 call_function_single_interrupt+0xf/0x20 Fixes: f9d03f96b988 ("block: improve handling of the magic discard payload") Reviewed-by: Ming Lei Reviewed-by: Christoph Hellwig Acked-by: Mike Snitzer Signed-off-by: Bart Van Assche Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- block/blk-core.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/block/blk-core.c +++ b/block/blk-core.c @@ -3487,6 +3487,10 @@ static void __blk_rq_prep_clone(struct r dst->cpu = src->cpu; dst->__sector = blk_rq_pos(src); dst->__data_len = blk_rq_bytes(src); + if (src->rq_flags & RQF_SPECIAL_PAYLOAD) { + dst->rq_flags |= RQF_SPECIAL_PAYLOAD; + dst->special_vec = src->special_vec; + } dst->nr_phys_segments = src->nr_phys_segments; dst->ioprio = src->ioprio; dst->extra_len = src->extra_len;