From: Al Viro <viro@ZenIV.linux.org.uk>
To: Anton Altaparmakov <anton@tuxera.com>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Race condition between iget_locked() and evict_inodes()
Date: Thu, 29 Sep 2016 14:38:45 +0100 [thread overview]
Message-ID: <20160929133845.GP19539@ZenIV.linux.org.uk> (raw)
In-Reply-To: <22F987EA-A1F6-4138-80F5-EFAD7F63CA47@tuxera.com>
On Thu, Sep 29, 2016 at 12:56:49PM +0000, Anton Altaparmakov wrote:
> Hi Al,
>
> > On 29 Sep 2016, at 13:17, Al Viro <viro@ZenIV.linux.org.uk> wrote:
> >
> > On Thu, Sep 29, 2016 at 11:53:21AM +0000, Anton Altaparmakov wrote:
> >> Thus if the events happen in this order:
> >>
> >> evict_inodes() iget_locked() in find_inode_fast()
> >
> > ... you are buggered, because somebody is trying to grab a reference
> > to inode on a filesystem that is being shut down. Look at evict_inode()
> > caller...
>
> But what if that somebody is simply the file system being shutdown trying to flush some dirty metadata to disk which is stored in a file and thus accessed via an inode and thus iget on the inode is needed? Surely that is allowed even during shutdown. Once the write is complete iput() is called which then immediately evicts the inode as MS_ACTIVE is clear...
If it's a per-superblock inode, just keep it referenced until ->put_super()
and be done with that. Besides, the caller has just done sync_filesystem()
there, so any dirty metadata would better be already flushed.
prev parent reply other threads:[~2016-09-29 13:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-29 11:53 Race condition between iget_locked() and evict_inodes() Anton Altaparmakov
2016-09-29 12:17 ` Al Viro
2016-09-29 12:56 ` Anton Altaparmakov
2016-09-29 13:38 ` Al Viro [this message]
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=20160929133845.GP19539@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=anton@tuxera.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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