From: David Woodhouse <dwmw2@infradead.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Balaji Rao <balajirrao@gmail.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/3] Introduce btrfs_iget helper
Date: Wed, 13 Aug 2008 10:07:14 +0100 [thread overview]
Message-ID: <1218618434.2977.237.camel@pmac.infradead.org> (raw)
In-Reply-To: <20080812184654.GA29426@infradead.org>
On Tue, 2008-08-12 at 14:46 -0400, Christoph Hellwig wrote:
> Please leave the unlock_new_inode to the caller and kill the is_new
> parameter. Gives much nicer to read code, and generally making sure the
> inode is 100% ready and correct before unlocking it is a good idea, too
> so that e.g. no one can actually access an inode marked bad due to a
> generation number mismatch before it's marked bad.
Unconvinced -- I don't like the idea that we'd sometimes return a locked
inode, sometimes not, and force the callers to handle that.
And the inode _is_ ready and correct. We don't mark inodes bad because
of a generation number mismatch -- we just return -ESTALE and drop our
refcount on the inode. The inode itself is fine and there's no issue
with it being unlocked.
The code in btrfs_lookup() which goes...
/* the inode and parent dir are two different roots */
if (new && root != sub_root) {
igrab(inode);
sub_root->inode = inode;
do_orphan = 1;
}
... should also be fine when the inode is unlocked, too.
--
David Woodhouse Open Source Technology Centre
David.Woodhouse@intel.com Intel Corporation
next prev parent reply other threads:[~2008-08-13 9:07 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-28 23:35 [RFC] NFS Support Balaji Rao
2008-06-30 14:50 ` Josef Bacik
2008-06-30 15:20 ` Balaji Rao R
2008-06-30 15:08 ` Josef Bacik
2008-07-01 7:01 ` Christoph Hellwig
2008-06-30 18:46 ` Christoph Hellwig
2008-08-12 13:46 ` [PATCH 1/3] Introduce btrfs_iget helper David Woodhouse
2008-08-12 18:46 ` Christoph Hellwig
2008-08-13 9:07 ` David Woodhouse [this message]
2008-08-13 9:41 ` David Woodhouse
2008-08-12 13:46 ` [PATCH 2/3] NFS support for btrfs - v2 David Woodhouse
2008-08-12 18:51 ` Christoph Hellwig
2008-08-13 8:53 ` David Woodhouse
2008-08-13 15:06 ` [PATCH 2/3] NFS support for btrfs - v3 David Woodhouse
2008-08-12 13:46 ` [PATCH 3/3] Implement our own copy of the nfsd readdir hack, for older kernels David Woodhouse
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=1218618434.2977.237.camel@pmac.infradead.org \
--to=dwmw2@infradead.org \
--cc=balajirrao@gmail.com \
--cc=hch@infradead.org \
--cc=linux-btrfs@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