From: Reinette Chatre <reinette.chatre@intel.com>
To: Babu Moger <babu.moger@amd.com>, Tony Luck <tony.luck@intel.com>,
"Fenghua Yu" <fenghuay@nvidia.com>,
Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>,
Peter Newman <peternewman@google.com>,
James Morse <james.morse@arm.com>,
Drew Fustini <dfustini@baylibre.com>,
"Dave Martin" <Dave.Martin@arm.com>,
Chen Yu <yu.c.chen@intel.com>
Cc: Borislav Petkov <bp@alien8.de>, <x86@kernel.org>,
<linux-kernel@vger.kernel.org>, <patches@lists.linux.dev>
Subject: Re: [PATCH v2 4/5] fs/resctrl: Fix deadlock for errors during mount
Date: Mon, 18 May 2026 21:03:11 -0700 [thread overview]
Message-ID: <389e1f79-adb6-4c50-bb14-b22a3706a98b@intel.com> (raw)
In-Reply-To: <75aa4c10-8e5a-4a9b-b702-100d761fa13a@amd.com>
On 5/18/26 1:54 PM, Babu Moger wrote:
> Hi Tony,
>
>
> On 5/15/26 14:39, Tony Luck wrote:
>> From: Reinette Chatre <reinette.chatre@intel.com>
>>
>> Sashiko noticed[1] a deadlock in the resctrl mount code.
>>
>> rdt_get_tree() acquires rdtgroup_mutex before calling kernfs_get_tree(). If
>> superblock setup fails inside kernfs_get_tree(), the VFS calls kill_sb on
>> the same thread before the call returns. rdt_kill_sb() unconditionally
>> attempts to acquire rdtgroup_mutex and deadlock occurs.
>>
>> Move the call to kernfs_get_tree() outside of locks.
>>
>> Add resctrl_unmount() helper to keep code consistent between the
>> rdt_get_tree() failure path and a normal unmount.
>>
>> If kernfs_get_tree() fails and ctx->kfc.new_sb_created is set, then rdt_kill_sb()
>> has already been called and no further cleanup is needed.
>>
>> Add an extra hold in this error path on rdtgroup_default.kn to defend against
>> other races destroying the root which is then dereferenced in kernfs_kill_sb()
>>
>> Fixes: 5ff193fbde20 ("x86/intel_rdt: Add basic resctrl filesystem support")
>> Co-developed-by: Tony Luck <tony.luck@intel.com>
>> Signed-off-by: Tony Luck <tony.luck@intel.com>
>
> This should be
>
> Co-developed-by: Tony Luck <tony.luck@intel.com>
> Signed-off-by: Tony Luck <tony.luck@intel.com>
> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
I have not yet given my Signed-off-by to these patches. I am still wrangling with
sashiko's most recent concerns with the areas touched by this submission
https://sashiko.dev/#/patchset/20260515193944.15114-1-tony.luck%40intel.com
Reinette
next prev parent reply other threads:[~2026-05-19 4:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-15 19:39 [PATCH v2 0/5] fs/resctrl: Fix four long-standing issues Tony Luck
2026-05-15 19:39 ` [PATCH v2 1/5] fs/resctrl: Move functions to avoid forward references in subsequent fixes Tony Luck
2026-05-18 20:54 ` Babu Moger
2026-05-15 19:39 ` [PATCH v2 2/5] fs/resctrl: Free mon_data structures on rdt_get_tree() failure Tony Luck
2026-05-18 1:17 ` Chen, Yu C
2026-05-18 20:54 ` Babu Moger
2026-05-15 19:39 ` [PATCH v2 3/5] fs/resctrl: Fix use-after-free during unmount Tony Luck
2026-05-18 20:54 ` Babu Moger
2026-05-15 19:39 ` [PATCH v2 4/5] fs/resctrl: Fix deadlock for errors during mount Tony Luck
2026-05-18 20:54 ` Babu Moger
2026-05-19 4:03 ` Reinette Chatre [this message]
2026-05-15 19:39 ` [PATCH v2 5/5] fs/resctrl: Fix issues with worker threads when CPUs are taken offline Tony Luck
2026-05-18 20:55 ` Babu Moger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=389e1f79-adb6-4c50-bb14-b22a3706a98b@intel.com \
--to=reinette.chatre@intel.com \
--cc=Dave.Martin@arm.com \
--cc=babu.moger@amd.com \
--cc=bp@alien8.de \
--cc=dfustini@baylibre.com \
--cc=fenghuay@nvidia.com \
--cc=james.morse@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maciej.wieczor-retman@intel.com \
--cc=patches@lists.linux.dev \
--cc=peternewman@google.com \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
--cc=yu.c.chen@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®