]> git.karo-electronics.de Git - karo-tx-linux.git/commit
nfsd: Ensure nfsv4 calls the underlying filesystem on LOCKT
authorJ. Bruce Fields <bfields@citi.umich.edu>
Sat, 20 Dec 2008 19:58:38 +0000 (11:58 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 6 Feb 2009 21:47:20 +0000 (13:47 -0800)
commit05b3cbed318b32175df7cfbafd0cac04cff6b776
tree57f1a5010b6b3e264e7b6d8f6df8ef84ae455d74
parentd47d1c2e6541d2a53d9a2cfc41eec021ec8af95b
nfsd: Ensure nfsv4 calls the underlying filesystem on LOCKT

commit 55ef1274dddd4de387c54d110e354ffbb6cdc706 upstream.

Since nfsv4 allows LOCKT without an open, but the ->lock() method is a
file method, we fake up a struct file in the nfsv4 code with just the
fields we need initialized.  But we forgot to initialize the file
operations, with the result that LOCKT never results in a call to the
filesystem's ->lock() method (if it exists).

We could just add that one more initialization.  But this hack of faking
up a struct file with only some fields initialized seems the kind of
thing that might cause more problems in the future.  We should either do
an open and get a real struct file, or make lock-testing an inode (not a
file) method.

This patch does the former.

Reported-by: Marc Eshel <eshel@almaden.ibm.com>
Tested-by: Marc Eshel <eshel@almaden.ibm.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/nfsd/nfs4state.c