From: Al Viro <viro@zeniv.linux.org.uk>
To: Max Kellermann <max.kellermann@ionos.com>
Cc: Mateusz Guzik <mjguzik@gmail.com>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Linux Memory Management List <linux-mm@kvack.org>,
ceph-devel@vger.kernel.org
Subject: Re: Need advice with iput() deadlock during writeback
Date: Wed, 17 Sep 2025 21:29:14 +0100 [thread overview]
Message-ID: <20250917202914.GZ39973@ZenIV> (raw)
In-Reply-To: <CAKPOu+_WNgA=8jUa5BiB0_3c+4EoKJdoh9S-tCEuz=3o0WpsiA@mail.gmail.com>
On Wed, Sep 17, 2025 at 10:19:27PM +0200, Max Kellermann wrote:
> On Wed, Sep 17, 2025 at 10:14 PM Al Viro <viro@zeniv.linux.org.uk> wrote:
> > Looks rather dangerous - what do you do on fs shutdown?
>
> Sorry, I'm new to this, I don't know how fs shutdown works - stupid
> question: is my code any more dangerous than what's already happening
> with ceph_queue_inode_work()?
umount /wherever/the/fuck/it/is/mounted
calls umount(2), which removes the mount from the tree, then calls
deactivate_super(), dropping the active reference to superblock.
If it hadn't been mounted elsewhere, that's the last reference and
we this:
shrinker_free(s->s_shrink);
fs->kill_sb(s);
kill_super_notify(s);
/*
* Since list_lru_destroy() may sleep, we cannot call it from
* put_super(), where we hold the sb_lock. Therefore we destroy
* the lru lists right now.
*/
list_lru_destroy(&s->s_dentry_lru);
list_lru_destroy(&s->s_inode_lru);
put_filesystem(fs);
put_super(s);
At some point ->kill_sb() will call generic_shutdown_super() (in case of ceph
that's done via kill_anon_super()), where we get to evict_inodes(). Any
busy inode at that point is a bad problem...
next prev parent reply other threads:[~2025-09-17 20:29 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-17 8:07 Max Kellermann
2025-09-17 8:23 ` Mateusz Guzik
2025-09-17 8:38 ` Max Kellermann
2025-09-17 8:59 ` Mateusz Guzik
2025-09-17 9:20 ` Max Kellermann
2025-09-17 9:32 ` Mateusz Guzik
2025-09-17 12:48 ` Max Kellermann
2025-09-17 20:14 ` Al Viro
2025-09-17 20:19 ` Max Kellermann
2025-09-17 20:29 ` Al Viro [this message]
2025-09-17 20:32 ` Max Kellermann
2025-09-17 20:23 ` Mateusz Guzik
2025-09-17 20:34 ` Al Viro
2025-09-17 20:36 ` Max Kellermann
2025-09-17 21:10 ` Al Viro
2025-09-17 21:19 ` Max Kellermann
2025-09-17 21:20 ` Mateusz Guzik
2025-09-17 20:39 ` Mateusz Guzik
2025-09-17 21:02 ` Al Viro
2025-09-17 21:18 ` Mateusz Guzik
2025-09-17 21:42 ` Al Viro
2025-09-17 22:58 ` Mateusz Guzik
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=20250917202914.GZ39973@ZenIV \
--to=viro@zeniv.linux.org.uk \
--cc=ceph-devel@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=max.kellermann@ionos.com \
--cc=mjguzik@gmail.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