]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd4: acquire only one lease per file
authorJ. Bruce Fields <bfields@redhat.com>
Tue, 1 Feb 2011 00:20:39 +0000 (19:20 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 14 Feb 2011 15:35:19 +0000 (10:35 -0500)
commit4464e63df81e83b1f88b23592da32535bfa3f8f2
treef04f5f069191fa984a394154efdf766898bffcaf
parent7ed76fb6958ccffe3b4acf52339f1b5c62fb7399
nfsd4: acquire only one lease per file

Instead of acquiring one lease each time another client opens a file,
nfsd can acquire just one lease to represent all of them, and reference
count it to determine when to release it.

This fixes a regression introduced by
23a404c06e5d0d6980d7e8f18d0a6dc89885341e "locks: eliminate fl_mylease
callback": after that patch, only the struct file * is used to determine
who owns a given lease.  But since we recently converted the server to
share a single struct file per open, if we acquire multiple leases on
the same file from nfsd, it then becomes impossible on unlocking a lease
to determine which of those leases (all of whom share the same struct
file *) we meant to remove.

Thanks to Takashi Iwai <tiwai@suse.de> for catching a bug in a previous
version of this patch.

Tested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4state.c
fs/nfsd/state.h