From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A8913ACA66 for ; Mon, 30 Mar 2026 09:56:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774864603; cv=none; b=E9F/OAUFTbliI5iUIzrl9N4F8awzlGuJEm51EAvlWZgV4T5W8y1WVP1w2WISbz2bQABZ0G07CuA9jzpbvfzUhYQE8LQM7k+mWT0rHTOpWPKkpkg2Os2HrikRyW36iaEWiwBylQQX0awJGe0lA8vEVWLqKumbU+BPNFfXQb4TaWI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774864603; c=relaxed/simple; bh=/PbAYG8gWTXsrLFUKLpCtw2Ce1Q7aTJT7Aa45X1dTag=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=MybQaOXTo09jiu1kZOU6qUuI9zW6NIBl8K4Xm5TlYdB3lrrAUxQ/tqmi0eQJAyvyIPMLtf0bVeB5E+l2cWJRp+YwMuZWn7V34e9JXVvUBM0vRH7o1dOzaI9bgFXwc+9aWl4FGdIEJ5nploKq6BNW8YUxpDck31wsIBdrzaQDBno= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=KgtHXqW3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="KgtHXqW3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C7CEC4CEF7; Mon, 30 Mar 2026 09:56:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774864602; bh=/PbAYG8gWTXsrLFUKLpCtw2Ce1Q7aTJT7Aa45X1dTag=; h=Subject:To:Cc:From:Date:From; b=KgtHXqW37xkn1/6KRm+Ca0UZsnAHPZhABxyydFPdCBTT9diR4xDyYsd+YAmkiw00g ONZ5cKOI/Bvnr43MFGcWC/hLkkCjQwF8rKsSUq/+CA3o155RP/TaMnt+9xF1MQ72xW ZIN4TzHE85KWkJ0THcaSlNqYNJDonIXDc1DCZ07c= Subject: FAILED: patch "[PATCH] xfs: stop reclaim before pushing AIL during unmount" failed to apply to 5.10-stable tree To: ytohnuki@amazon.com,cem@kernel.org,djwong@kernel.org Cc: From: Date: Mon, 30 Mar 2026 11:56:39 +0200 Message-ID: <2026033039-geranium-flame-8f03@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.10-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y git checkout FETCH_HEAD git cherry-pick -x 4f24a767e3d64a5f58c595b5c29b6063a201f1e3 # git commit -s git send-email --to '' --in-reply-to '2026033039-geranium-flame-8f03@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 4f24a767e3d64a5f58c595b5c29b6063a201f1e3 Mon Sep 17 00:00:00 2001 From: Yuto Ohnuki Date: Tue, 10 Mar 2026 18:38:37 +0000 Subject: [PATCH] xfs: stop reclaim before pushing AIL during unmount The unmount sequence in xfs_unmount_flush_inodes() pushed the AIL while background reclaim and inodegc are still running. This is broken independently of any use-after-free issues - background reclaim and inodegc should not be running while the AIL is being pushed during unmount, as inodegc can dirty and insert inodes into the AIL during the flush, and background reclaim can race to abort and free dirty inodes. Reorder xfs_unmount_flush_inodes() to stop inodegc and cancel background reclaim before pushing the AIL. Stop inodegc before cancelling m_reclaim_work because the inodegc worker can re-queue m_reclaim_work via xfs_inodegc_set_reclaimable. Reported-by: syzbot+652af2b3c5569c4ab63c@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=652af2b3c5569c4ab63c Fixes: 90c60e164012 ("xfs: xfs_iflush() is no longer necessary") Cc: stable@vger.kernel.org # v5.9 Signed-off-by: Yuto Ohnuki Reviewed-by: Darrick J. Wong Signed-off-by: Carlos Maiolino diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 9c295abd0a0a..ef1ea8a1238c 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -608,8 +608,9 @@ xfs_unmount_check( * have been retrying in the background. This will prevent never-ending * retries in AIL pushing from hanging the unmount. * - * Finally, we can push the AIL to clean all the remaining dirty objects, then - * reclaim the remaining inodes that are still in memory at this point in time. + * Stop inodegc and background reclaim before pushing the AIL so that they + * are not running while the AIL is being flushed. Then push the AIL to + * clean all the remaining dirty objects and reclaim the remaining inodes. */ static void xfs_unmount_flush_inodes( @@ -621,9 +622,9 @@ xfs_unmount_flush_inodes( xfs_set_unmounting(mp); - xfs_ail_push_all_sync(mp->m_ail); xfs_inodegc_stop(mp); cancel_delayed_work_sync(&mp->m_reclaim_work); + xfs_ail_push_all_sync(mp->m_ail); xfs_reclaim_inodes(mp); xfs_health_unmount(mp); xfs_healthmon_unmount(mp);