From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10184C77B75 for ; Fri, 12 May 2023 22:59:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240168AbjELW72 (ORCPT ); Fri, 12 May 2023 18:59:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240191AbjELW7X (ORCPT ); Fri, 12 May 2023 18:59:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4AF21FEE for ; Fri, 12 May 2023 15:59:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 921ED6593C for ; Fri, 12 May 2023 22:59:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6C06C433D2; Fri, 12 May 2023 22:59:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1683932361; bh=zY53bGK957+YLif36uQmxkkXVaFoGAiqtFHNFNK3ULA=; h=Date:To:From:Subject:From; b=N/YwtoaHB8c2xAv64PlXvhtelIZHKeCgy64HdgagHN70KV2AFRFZ2XD4J/e4pDMgr RJXXS3RPg0wukep0UOm94yo33pQPbnQMtPYs8Oejj3kTtjssORYValNxRk88DdECjM 5S36zXWjieX4kyY+vnDcIjXw0mUjemcX4LKWPdxo= Date: Fri, 12 May 2023 15:59:20 -0700 To: mm-commits@vger.kernel.org, zhangpeng.00@bytedance.com, vernon2gm@gmail.com, senozhatsky@chromium.org, richard.weiyang@gmail.com, Liam.Howlett@oracle.com, dcb314@hotmail.com, Liam.Howlett@Oracle.com, akpm@linux-foundation.org From: Andrew Morton Subject: + maple_tree-change-rcu-checks-to-warn_on-instead-of-bug_on.patch added to mm-unstable branch Message-Id: <20230512225920.E6C06C433D2@smtp.kernel.org> Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org The patch titled Subject: maple_tree: change RCU checks to WARN_ON() instead of BUG_ON() has been added to the -mm mm-unstable branch. Its filename is maple_tree-change-rcu-checks-to-warn_on-instead-of-bug_on.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/maple_tree-change-rcu-checks-to-warn_on-instead-of-bug_on.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: "Liam R. Howlett" Subject: maple_tree: change RCU checks to WARN_ON() instead of BUG_ON() Date: Fri, 12 May 2023 14:20:09 -0400 If RCU is enabled and the tree isn't locked, just warn the user and avoid crashing the kernel. Link: https://lkml.kernel.org/r/20230512182036.359030-9-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Cc: David Binderman Cc: Peng Zhang Cc: Sergey Senozhatsky Cc: Vernon Yang Cc: Wei Yang Signed-off-by: Andrew Morton --- include/linux/maple_tree.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/include/linux/maple_tree.h~maple_tree-change-rcu-checks-to-warn_on-instead-of-bug_on +++ a/include/linux/maple_tree.h @@ -616,7 +616,7 @@ static inline void mt_clear_in_rcu(struc return; if (mt_external_lock(mt)) { - BUG_ON(!mt_lock_is_held(mt)); + WARN_ON(!mt_lock_is_held(mt)); mt->ma_flags &= ~MT_FLAGS_USE_RCU; } else { mtree_lock(mt); @@ -635,7 +635,7 @@ static inline void mt_set_in_rcu(struct return; if (mt_external_lock(mt)) { - BUG_ON(!mt_lock_is_held(mt)); + WARN_ON(!mt_lock_is_held(mt)); mt->ma_flags |= MT_FLAGS_USE_RCU; } else { mtree_lock(mt); _ Patches currently in -mm which might be from Liam.Howlett@Oracle.com are maple_tree-clean-up-mas_parent_enum-and-rename-to-mas_parent_type.patch maple_tree-add-format-option-to-mt_dump.patch maple_tree-convert-bug_on-to-mt_bug_on.patch maple_tree-change-rcu-checks-to-warn_on-instead-of-bug_on.patch maple_tree-convert-debug-code-to-use-mt_warn_on-and-mas_warn_on.patch