From: Christoph Hellwig <hch@infradead.org>
To: Anton Altaparmakov <aia21@cantab.net>
Cc: Alexander Viro <viro@math.psu.edu>,
Jan Harkes <jaharkes@cs.cmu.edu>,
linux-fsdevel@vger.kernel.org
Subject: Re: iget4/read_inode2 race in get_new_inode
Date: Mon, 29 Apr 2002 20:51:13 +0100 [thread overview]
Message-ID: <20020429205113.A31052@infradead.org> (raw)
In-Reply-To: <5.1.0.14.2.20020429201020.04a2eec0@pop.cus.cam.ac.uk>; from aia21@cantab.net on Mon, Apr 29, 2002 at 08:34:00PM +0100
On Mon, Apr 29, 2002 at 08:34:00PM +0100, Anton Altaparmakov wrote:
>
> - Replace iget4() with iget5() with an additional argument: a callback to
> initialize a locked inode in order to kill the race condition Jan found.
>
> struct inode *iget5(sb, ino, find_actor, init_locked_actor, void *opaque);
>
> - Let get_new_inode() call init_locked_actor before dropping the
> inode_lock. It then calls ->read_inode as usual.
Don't do this - rather use the XFS-style icreate() plus per-filesystem
exclusion. The VFS shouldn't have to worry about this kind of problems,
especially with such an ugly API.
> struct inode *fs_iget(sb, ino, find_actor, init_locked_actor, opaque,
> fs_read_inode)
> {
> inode = iget5(sb, ino, find_actor, init_locked_actor, opaque);
> if (inode has I_NEW set) {
> fs_read_inode(inode);
> unlock_new_inode(inode);
> }
> return inode;
> }
I already though about this alot (as generic_iget()), but I wonder whether
it is really worth the effort or whether filesystems should just duplicate
that 5 lines.
next prev parent reply other threads:[~2002-04-29 19:51 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-29 16:14 iget4/read_inode2 race in get_new_inode Jan Harkes
2002-04-29 16:48 ` Jan Harkes
2002-04-29 17:49 ` Alexander Viro
2002-04-29 19:34 ` Anton Altaparmakov
2002-04-29 19:39 ` Anton Altaparmakov
2002-04-29 19:41 ` Steve Lord
2002-04-29 19:51 ` Anton Altaparmakov
2002-04-29 19:51 ` Christoph Hellwig [this message]
2002-04-29 20:07 ` Anton Altaparmakov
2002-04-29 20:13 ` Christoph Hellwig
2002-04-29 20:24 ` Jan Harkes
2002-04-29 20:28 ` Anton Altaparmakov
2002-04-29 20:20 ` Jan Harkes
2002-04-29 20:31 ` Anton Altaparmakov
2002-04-29 20:48 ` Steve Lord
2002-04-29 20:58 ` Jan Harkes
2002-04-29 21:04 ` Steve Lord
2002-04-29 21:34 ` Anton Altaparmakov
2002-04-29 22:36 ` Alexander Viro
2002-04-29 22:54 ` Jan Harkes
2002-04-29 17:18 ` Anton Altaparmakov
2002-04-29 17:33 ` Jan Harkes
2002-04-29 17:44 ` Alexander Viro
2002-04-29 18:02 ` Jan Harkes
2002-04-29 18:22 ` Anton Altaparmakov
2002-04-29 18:30 ` Steve Lord
2002-04-29 18:39 ` Christoph Hellwig
2002-04-29 19:20 ` Steve Lord
2002-04-29 19:52 ` Christoph Hellwig
2002-04-29 22:02 ` Chris Mason
2002-04-29 19:12 ` Jan Harkes
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=20020429205113.A31052@infradead.org \
--to=hch@infradead.org \
--cc=aia21@cantab.net \
--cc=jaharkes@cs.cmu.edu \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@math.psu.edu \
/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