From: Andrew Morton <akpm@osdl.org>
To: David Woodhouse <dwmw2@infradead.org>
Cc: dedekind@infradead.org, miklos@szeredi.hu,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] VFS bugfix: two read_inode() calles without clear_inode() call between
Date: Wed, 4 May 2005 14:58:11 -0700 [thread overview]
Message-ID: <20050504145811.63e9bb10.akpm@osdl.org> (raw)
In-Reply-To: <1115242507.12012.394.camel@baythorne.infradead.org>
David Woodhouse <dwmw2@infradead.org> wrote:
>
> On Wed, 2005-05-04 at 13:04 -0700, Andrew Morton wrote:
> > This sounds more like a bug in the iget() caller to me.
> >
> > Question is: if the inode has zero refcount and is unhashed then how
> > did the caller get its sticky paws onto the inode* in the first place?
> >
> > If the caller had saved a copy of the inode* in local storage then the
> > caller should have taken a ref against the inode.
> >
> > If the caller had just looked up the inode via hastable lookup via
> > iget_whatever() then again the caller will have a ref on the inode.
> >
> > So. Please tell us more about how the caller got into this situation.
>
> I could explain in detail how JFFS2 garbage collection works, moving log
> entries out of the way by calling iget() on the inode to which they
> belong.... or I could just say "NFS".
>
That doesn't really settle the question of whether the callers are broken,
whether they are doing something which the VFS really should support and
what need to be done to the VFS to support it properly.
Looking at the proposed patch: what happens if an inode is on its way to
dispose_list() and someone tries to do an iget() on it? I don't think I_LOCK
is set, so __wait_on_freeing_inode() will no longer provide this guarantee:
/*
* If we try to find an inode in the inode hash while it is being deleted, we
* have to wait until the filesystem completes its deletion before reporting
* that it isn't found. This is because iget will immediately call
* ->read_inode, and we want to be sure that evidence of the deletion is found
* by ->read_inode.
Not only will we break the __wait_on_freeing_inode() guarantee, but we'll
break it in extremely rare circumstances.
And that's just from a quick peek. There may be other problems. Worried.
next prev parent reply other threads:[~2005-05-04 21:57 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-27 13:15 [PATCH] VFS bugfix: two read_inode() calles without clear_inode() call between Artem B. Bityuckiy
2005-04-27 13:42 ` Jan Harkes
2005-04-27 14:22 ` Miklos Szeredi
2005-04-27 15:57 ` Miklos Szeredi
2005-04-27 16:19 ` Artem B. Bityuckiy
[not found] ` <E1DQqZu-0002Rf-00@dorka.pomaz.szeredi.hu>
2005-04-28 7:32 ` Artem B. Bityuckiy
2005-04-28 7:34 ` Andrew Morton
2005-05-04 12:17 ` Artem B. Bityuckiy
2005-05-04 20:04 ` Andrew Morton
2005-05-04 21:35 ` David Woodhouse
2005-05-04 21:58 ` Andrew Morton [this message]
2005-05-05 9:10 ` David Woodhouse
2005-05-05 16:18 ` Miklos Szeredi
2005-05-06 11:08 ` David Woodhouse
2005-06-13 14:45 ` Synchronous FAT Artem B. Bityuckiy
2005-06-14 1:06 ` Coywolf Qi Hunt
2005-06-14 12:16 ` Artem B. Bityuckiy
2005-06-15 1:19 ` Coywolf Qi Hunt
2005-04-28 7:41 ` [PATCH] VFS bugfix: two read_inode() calles without clear_inode() call between Miklos Szeredi
2005-04-28 7:47 ` Artem B. Bityuckiy
-- strict thread matches above, loose matches on Subject: below --
2005-04-19 12:38 Artem B. Bityuckiy
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=20050504145811.63e9bb10.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=dedekind@infradead.org \
--cc=dwmw2@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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).