From: Andrew Morton <akpm@osdl.org>
To: Chris Mason <mason@suse.com>
Cc: mika.penttila@kolumbus.fi, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] writeback_inodes can race with unmount
Date: Tue, 8 Jun 2004 14:56:27 -0700 [thread overview]
Message-ID: <20040608145627.0191c026.akpm@osdl.org> (raw)
In-Reply-To: <1086725926.10973.161.camel@watt.suse.com>
Chris Mason <mason@suse.com> wrote:
>
> On Tue, 2004-06-08 at 15:57, Mika Penttilä wrote:
> > Chris Mason wrote:
> >
> > >There's a small window where the filesystem can be unmounted during
> > >writeback_inodes. The end result is the iput done by sync_sb_inodes
> > >could be done after the FS put_super and and the super has been removed
> > >from all lists.
> > >
> > >
> >
> > Why don't we have the same race in the sync() path as well? Moving the
> > locking to sync_sb_inodes() itself would fix it also.
>
> In the sync() path we're already taking a read lock on s_umount sem.
> Moving the locking into sync_sb_inodes would be tricky, it is sometimes
> called with the write lock on s_umount_sem held and sometimes with a
> read lock.
>
Plus we'd be dead if we had to do the above. If that read_trylock() fails
the sync() will forget to sync stuff.
And, contra your description, we'll fail the trylock relatively frequently
- when some other process is writing back this superblock.
But as this codepath is never used for data-integrity writeout things
should be OK. I'll slip a comment in there and maybe a
BUG_ON(wbc->sync_mode == WB_SYNC_ALL).
You didn't tell us where the window is? It's a bit weird that some other
process can come in and unmount the fs while there are non-zero-refcount
inodes floating about on the superblock.
next prev parent reply other threads:[~2004-06-08 21:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-08 19:22 [PATCH] writeback_inodes can race with unmount Chris Mason
2004-06-08 19:57 ` Mika Penttilä
2004-06-08 20:18 ` Chris Mason
2004-06-08 21:56 ` Andrew Morton [this message]
2004-06-09 1:29 ` Chris Mason
2004-06-09 3:22 ` Andrew Morton
2004-06-09 5:24 ` Andrew Morton
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=20040608145627.0191c026.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mason@suse.com \
--cc=mika.penttila@kolumbus.fi \
/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