Linux NFS development
 help / color / mirror / Atom feed
* nfsd4_locku / nfs4_free_lock_stateid question
@ 2014-07-13 11:00 Christoph Hellwig
  2014-07-13 12:05 ` Jeff Layton
  0 siblings, 1 reply; 8+ messages in thread
From: Christoph Hellwig @ 2014-07-13 11:00 UTC (permalink / raw)
  To: Jeff Layton; +Cc: linux-nfs

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?

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-07-15 16:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-13 11:00 nfsd4_locku / nfs4_free_lock_stateid question Christoph Hellwig
2014-07-13 12:05 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox