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 964A1C5479D for ; Mon, 9 Jan 2023 23:40:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237060AbjAIXkb (ORCPT ); Mon, 9 Jan 2023 18:40:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234679AbjAIXkS (ORCPT ); Mon, 9 Jan 2023 18:40:18 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD3D325C5 for ; Mon, 9 Jan 2023 15:40:17 -0800 (PST) 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 75F1F6148D for ; Mon, 9 Jan 2023 23:40:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADEBBC433F1; Mon, 9 Jan 2023 23:40:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1673307616; bh=Iqe0qsU87lSmRtY0iTV2+/EEr/SxyNCXW4QzUGAMDrE=; h=Date:To:From:Subject:From; b=Nw0uiYrULtQDTvf1GtcFg9Aj4k4bjs2VF7JIRpd6R7O41NIPUkqK3+qn4kJqN9mDV P2BUmIIgzFBpiIZsm8/0Z/lcm9IYsekbf6D6iOrPyKinKzwGVKYM2/Pg/beoSTpmR8 Q5eP5hvJpM/CoUlm6mFP606yY6oCJ8kYVD70kamQ= Date: Mon, 09 Jan 2023 15:40:16 -0800 To: mm-commits@vger.kernel.org, sj@kernel.org, Liam.Howlett@oracle.com, liam.howlett@oracle.com, akpm@linux-foundation.org From: Andrew Morton Subject: + maple_tree-fix-handle-of-invalidated-state-in-mas_wr_store_setup.patch added to mm-hotfixes-unstable branch Message-Id: <20230109234016.ADEBBC433F1@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: fix handle of invalidated state in mas_wr_store_setup() has been added to the -mm mm-hotfixes-unstable branch. Its filename is maple_tree-fix-handle-of-invalidated-state-in-mas_wr_store_setup.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/maple_tree-fix-handle-of-invalidated-state-in-mas_wr_store_setup.patch This patch will later appear in the mm-hotfixes-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 Howlett Subject: maple_tree: fix handle of invalidated state in mas_wr_store_setup() Date: Mon, 9 Jan 2023 16:55:42 +0000 If an invalidated maple state is encountered during write, reset the maple state to MAS_START. This will result in a re-walk of the tree to the correct location for the write. Link: https://lore.kernel.org/all/20230107020126.1627-1-sj@kernel.org/ Link: https://lkml.kernel.org/r/20230109165455.647400-1-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Reported-by: SeongJae Park Tested-by: SeongJae Park Signed-off-by: Andrew Morton --- lib/maple_tree.c | 3 +++ 1 file changed, 3 insertions(+) --- a/lib/maple_tree.c~maple_tree-fix-handle-of-invalidated-state-in-mas_wr_store_setup +++ a/lib/maple_tree.c @@ -5610,6 +5610,9 @@ static inline void mte_destroy_walk(stru static void mas_wr_store_setup(struct ma_wr_state *wr_mas) { + if (unlikely(mas_is_paused(wr_mas->mas))) + mas_reset(wr_mas->mas); + if (!mas_is_start(wr_mas->mas)) { if (mas_is_none(wr_mas->mas)) { mas_reset(wr_mas->mas); _ Patches currently in -mm which might be from liam.howlett@oracle.com are nommu-fix-memory-leak-in-do_mmap-error-path.patch nommu-fix-do_munmap-error-path.patch nommu-fix-split_vma-map_count-error.patch maple_tree-fix-handle-of-invalidated-state-in-mas_wr_store_setup.patch mm-add-temporary-vma-iterator-versions-of-vma_merge-split_vma-and-__split_vma-fix.patch maple_tree-remove-gfp_zero-from-kmem_cache_alloc-and-kmem_cache_alloc_bulk.patch