From patchwork Mon Jun 19 14:20:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Snitzer X-Patchwork-Id: 9795979 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2FD4660381 for ; Mon, 19 Jun 2017 14:20:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07D641FEBD for ; Mon, 19 Jun 2017 14:20:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F0F05271CB; Mon, 19 Jun 2017 14:20:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BB091FEBD for ; Mon, 19 Jun 2017 14:20:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750905AbdFSOUd (ORCPT ); Mon, 19 Jun 2017 10:20:33 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:35581 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750886AbdFSOUd (ORCPT ); Mon, 19 Jun 2017 10:20:33 -0400 Received: by mail-qk0-f194.google.com with SMTP id 16so1646299qkg.2 for ; Mon, 19 Jun 2017 07:20:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=43cBSUx0xjhHlL8q6RrMx55bGqc4dgZhAGoSzxFeQK4=; b=mHQJu/qAPwMjOTnTdNUmVKQ6DPXKOFOVCLMhbHyEght+r/aYEfBK5A2w18kyBZklDc 4J24NPAtJ5Lf+d4P7Ul/Ys7OlCz0PjwA+jOMAVTgxdzQbHGmOFORYZ6OF2SC8kVCAO7x OKN1pjmTmc+WzGi7AfaKFcIoGN3r8CrA+vzXPFv5ZCNo+hCt4MI/P3dusF2ivutNqSDn ihiZK1X0s6r0IMZeaEyj2xM7/4u4UHz0tXJdhi6Aq5en+lh/42h7E64ceWmAnzcCgshD moarD8Zhg1uGjiiIcIvH/W4gRRoIa/rYi0bWq8TI/T9qfdpA7Y0L5FKPqvrtBq39U99U /aHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=43cBSUx0xjhHlL8q6RrMx55bGqc4dgZhAGoSzxFeQK4=; b=acTOLw99ZVSotEJ0qFQjUHXUJB5HhflCd5lcCnvS/k4YqfM5fI/fUq1sSIVNUY4g45 IIOQEGsxOhGsm9OCcAjzYcHziYRBsY/dkYcGTFKUA8VRN7/nFVLjCDcw9R2QKc+3k7JP uXuBoRv9T3TleKjYGEl8CKrEITz7CvRR2mf6RGhbDiB+/46rwsDG4qBOQF9TjtFbxXKu gcU7S9Tx03DCNW7FFU78bF3Anle8+QJFCGOsgVVEx0lvBsctpdizPK+kNUakiQwpRmr5 FHUQC5D4ZCncLP7ci3y0bWGwaG1sSVGUA1uZRY3cCyU2XCnXmjlgbtDZvwcCSfiOlyIU MPRA== X-Gm-Message-State: AKS2vOxboyptcJkHp7cl0p5V1JqxXD9wmOo7DWZ6TzxOBTt919f8wWzZ iY9DZE1D5WKbKQ== X-Received: by 10.55.134.69 with SMTP id i66mr27657914qkd.91.1497882032421; Mon, 19 Jun 2017 07:20:32 -0700 (PDT) Received: from localhost ([66.187.232.66]) by smtp.gmail.com with ESMTPSA id g83sm6272084qke.42.2017.06.19.07.20.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Jun 2017 07:20:30 -0700 (PDT) Date: Mon, 19 Jun 2017 10:20:28 -0400 From: Mike Snitzer To: Ondrej Kozina Cc: dm-devel@redhat.com, linux-block@vger.kernel.org, mpatocka@redhat.com, mbroz@redhat.com Subject: Re: dm integrity tests crash kernel (4.12-rc5) Message-ID: <20170619142026.GA92582@redhat.com> References: <2b97933e-3f94-8510-cefd-13fae445400e@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Jun 19 2017 at 8:11am -0400, Ondrej Kozina wrote: > same log again, hopefully prettier format. Sorry: > > [ 330.980914] DEBUG_LOCKS_WARN_ON(current->hardirq_context) > [ 330.980923] ------------[ cut here ]------------ > [ 330.982627] WARNING: CPU: 1 PID: 0 at kernel/locking/lockdep.c:2748 trace_hardirqs_on_caller+0x107/0x180 ... > [ 331.011968] Call Trace: > [ 331.012806] > [ 331.013684] trace_hardirqs_on+0xd/0x10 > [ 331.014732] _raw_spin_unlock_irq+0x27/0x30 > [ 331.015840] submit_flush_bio+0x4e/0x80 [dm_integrity] > [ 331.017157] do_endio_flush+0x41/0x70 [dm_integrity] > [ 331.018476] dec_in_flight+0x59/0x110 [dm_integrity] > [ 331.019767] integrity_end_io+0x5e/0x70 [dm_integrity] > [ 331.020965] bio_endio+0x7c/0x1a0 > [ 331.021917] blk_update_request+0x9f/0x3d0 > [ 331.023050] blk_mq_end_request+0x15/0x60 > [ 331.024224] lo_complete_rq+0x2b/0x80 > [ 331.025406] __blk_mq_complete_request_remote+0xe/0x10 > [ 331.026813] flush_smp_call_function_queue+0x4f/0x110 > [ 331.028173] generic_smp_call_function_single_interrupt+0xe/0x20 > [ 331.029616] smp_call_function_single_interrupt+0x22/0x30 > [ 331.031125] call_function_single_interrupt+0x90/0xa0 > [ 331.032819] RIP: 0010:default_idle+0x1b/0x180 Looks like submit_flush_bio() is disabling/enabling interrupts from interrupt context. Ondrej, does this patch fix the issue? diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c index 4ab10cf..93b1810 100644 --- a/drivers/md/dm-integrity.c +++ b/drivers/md/dm-integrity.c @@ -1105,10 +1105,13 @@ static void schedule_autocommit(struct dm_integrity_c *ic) static void submit_flush_bio(struct dm_integrity_c *ic, struct dm_integrity_io *dio) { struct bio *bio; - spin_lock_irq(&ic->endio_wait.lock); + unsigned long flags; + + spin_lock_irqsave(&ic->endio_wait.lock, flags); bio = dm_bio_from_per_bio_data(dio, sizeof(struct dm_integrity_io)); bio_list_add(&ic->flush_bio_list, bio); - spin_unlock_irq(&ic->endio_wait.lock); + spin_unlock_irqrestore(&ic->endio_wait.lock, flags); + queue_work(ic->commit_wq, &ic->commit_work); }