From: Christoph Hellwig <hch@infradead.org>
To: Jeff Layton <jlayton@primarydata.com>
Cc: linux-nfs@vger.kernel.org
Subject: nfsd4_locku / nfs4_free_lock_stateid question
Date: Sun, 13 Jul 2014 04:00:47 -0700 [thread overview]
Message-ID: <20140713110047.GA28727@infradead.org> (raw)
Hi Jeff,
while reviewing some of your patches I've started wondering about
some v4 locking code.
In nfsd4_locku we're doing a call to find_any_file to grab a file
structure for the lock stateid, which nfs4_free_lock_stateid tries to
close. But what guarantees that we're actually getting the same file
descriptor back?
The nfs4_file is shared by and stateid that access a given inode,
so the first call to find_any_file might return the read/only file
structure because that's the only one available so far, while
by the time we unlock we might have a read/write and/or write-only file
available as well, which find_any_file will return.
It seems like the lock stateid needs a pointer to the actual file
locked, and keep a reference to it independent of the nfs4_file, or am I
missing something?
next reply other threads:[~2014-07-13 11:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-13 11:00 Christoph Hellwig [this message]
2014-07-13 12:05 ` nfsd4_locku / nfs4_free_lock_stateid question Jeff Layton
2014-07-13 12:19 ` Christoph Hellwig
2014-07-13 13:50 ` Jeff Layton
2014-07-15 12:13 ` Jeff Layton
2014-07-15 14:50 ` J. Bruce Fields
2014-07-15 15:53 ` Christoph Hellwig
2014-07-15 16:56 ` Jeff Layton
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=20140713110047.GA28727@infradead.org \
--to=hch@infradead.org \
--cc=jlayton@primarydata.com \
--cc=linux-nfs@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.