Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1723260ybc; Wed, 13 Nov 2019 03:22:39 -0800 (PST) X-Google-Smtp-Source: APXvYqwIH6L/TS1bmLvRIyDqg5fizBAnKBXTGxt8yu0ILeuy7UJUn2RlrBMSVFgdNTRTSdYYOEcd X-Received: by 2002:a17:906:a388:: with SMTP id k8mr2057546ejz.223.1573644159638; Wed, 13 Nov 2019 03:22:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573644159; cv=none; d=google.com; s=arc-20160816; b=mjyWRX5gUCq8jAH4ka1v7/rFFp092uwma0Q7+fVdr8hUwC7Cz0ZOfCZd8HW2v+ZFnm wKRbH8If9OgxuOUvwxIgH8RjxUrr3HEtZ0Gyu0pYxisx/luwh34VsR5nF2/1vdvUbl0L oJ0Uu1thhcC3geieG3x6FebMtDGLulb/hompQXzWP8cCBJJ2MJGgMRMamAVmEJqnMigK XiRL51b0bGbgV7VABVyIj9cASzbx0F6e+ReLj95/+e2O4e41DC774e2Daj5LBmFz/IO9 0gHxy3D22ZB2pHDGb8nM3bNTsHX4DCS48coh8hc6PI6WYunljY9TMVr4CxJ4sqBLRVmx ntOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:message-id:in-reply-to:subject:cc:to:from :date:dkim-signature; bh=+4DKEG1YD9+fOubUldl9MnL4bU7MmbHESVaIk7Jx6mw=; b=IxBcZTC3LpkzoNTTxXJIoudAHVVqGqDQxFJj0jSQMdtru5/2knFb6F+H/J/XpfF4mk r7GFZ4OGupRvyoUIX9CLZxOj/4uz5tagjahqBU9WKlk21Cbi7JGT04psE9Ct6DKWoArQ ZQS9dYW9/uVguG3kHxtnAJf1p22d1yFkBwTTuY3TglwHj04Qsw3kGIJizLg2UC4VeEwr zidxGjiDYOSmJU/hppojYg4psBu9yoVkul0GThuNtxiK2PKwt9BmWPEIBwBFz7WaZnCc XhBBBlFrbisfGQjtSO1oQ7/Avf8NIAROHuI357HeDsajrs9Djg3eROItnx7APHrp93lA 5Vvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LerTC+FO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g11si834788ejj.11.2019.11.13.03.22.14; Wed, 13 Nov 2019 03:22:39 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LerTC+FO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726339AbfKMLSS (ORCPT + 99 others); Wed, 13 Nov 2019 06:18:18 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:56286 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727171AbfKMLSS (ORCPT ); Wed, 13 Nov 2019 06:18:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573643896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+4DKEG1YD9+fOubUldl9MnL4bU7MmbHESVaIk7Jx6mw=; b=LerTC+FOqBT4kru6Y7lOowwUe14QAAnZqtbXZvo0JE2CmEqI/Y0RC35FO3V9SEZYDitAoo jOgPdHMNMzEYCteAjZdEu5CfKdNBG9kK6AcXb8310DwihsuSoxOpQwCoxXp9C450uj/6PC Dpyns1oGKHS9aJ69UDu2ra+pVlW2UzQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-40-i03voM_8MgmSRku1iW4VOA-1; Wed, 13 Nov 2019 06:18:13 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 48304107ACC5; Wed, 13 Nov 2019 11:18:12 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4440D6106E; Wed, 13 Nov 2019 11:18:09 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id xADBI8gN023568; Wed, 13 Nov 2019 06:18:08 -0500 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id xADBI80c023564; Wed, 13 Nov 2019 06:18:08 -0500 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Wed, 13 Nov 2019 06:18:08 -0500 (EST) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: tglx@linutronix.de, linux-rt-users@vger.kernel.org cc: Mike Snitzer , Nikos Tsironis , Scott Wood , Ilias Tsitsimpis , dm-devel@redhat.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Daniel Wagner , Sebastian Andrzej Siewior Subject: [PATCH RT 2/2 v3] list_bl: avoid BUG when the list is not locked In-Reply-To: Message-ID: References: User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: i03voM_8MgmSRku1iW4VOA-1 X-Mimecast-Spam-Score: 0 Content-Type: TEXT/PLAIN; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org list_bl would crash with BUG() if we used it without locking. dm-snapshot= =20 uses its own locking on realtime kernels (it can't use list_bl because=20 list_bl uses raw spinlock and dm-snapshot takes other non-raw spinlocks=20 while holding bl_lock). To avoid this BUG, we must set LIST_BL_LOCKMASK =3D 0. This patch is intended only for the realtime kernel patchset, not for the= =20 upstream kernel. Signed-off-by: Mikulas Patocka --- include/linux/list_bl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-rt-devel/include/linux/list_bl.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- linux-rt-devel.orig/include/linux/list_bl.h=092019-11-13 12:15:50.00000= 0000 +0100 +++ linux-rt-devel/include/linux/list_bl.h=092019-11-13 12:15:50.000000000 = +0100 @@ -19,7 +19,7 @@ * some fast and compact auxiliary data. */ =20 -#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) +#if (defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)) && !defined(CO= NFIG_PREEMPT_RT_BASE) #define LIST_BL_LOCKMASK=091UL #else #define LIST_BL_LOCKMASK=090UL