From: David Chen <david.chen@osnexus.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: lkml <linux-kernel@vger.kernel.org>,
linux-fsdevel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] vfs: check i_count under lock in evict_inodes
Date: Mon, 11 Jul 2016 18:31:57 -0700 [thread overview]
Message-ID: <CAK1sfubpLBv3P5ttpuq1z+EyNGHFiiMEVLSCv5HoQ51f_pFHig@mail.gmail.com> (raw)
In-Reply-To: <20160712004623.GA14480@ZenIV.linux.org.uk>
Hi Al,
I'm not sure about the in-tree fs, but in zfsonlinux, it would offload
iput to a thread, so this would happen there. And it would wait for
the thread in put_super(), so that part is not a problem...
Thanks
2016-07-11 17:46 GMT-07:00 Al Viro <viro@zeniv.linux.org.uk>:
> On Mon, Jul 11, 2016 at 05:15:04PM -0700, Chunwei Chen wrote:
>> We need to check i_count again with i_lock held, because iput might re-add
>> i_count when lazytime is on. Without this check, we could end up with
>> double-free or use-after-free.
>
> Details, please. Ideally - with a reproducer. Who is calling that iput()
> at that point of generic_shutdown_super() (has to be another thread) and
> just what will happen if the same iput() is delayed until *after*
> evict_inodes(), all the way into ->put_super(). At which point there's
> no promise whatsoever that the data structures used by ->evict_inode()
> hadn't been already freed...
>
next prev parent reply other threads:[~2016-07-12 1:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-12 0:15 [PATCH] vfs: check i_count under lock in evict_inodes Chunwei Chen
2016-07-12 0:46 ` Al Viro
2016-07-12 1:31 ` David Chen [this message]
2016-07-12 1:40 ` Christoph Hellwig
2016-07-12 5:26 ` Al Viro
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=CAK1sfubpLBv3P5ttpuq1z+EyNGHFiiMEVLSCv5HoQ51f_pFHig@mail.gmail.com \
--to=david.chen@osnexus.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).