]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd: take struct file setup fully into nfs4_preprocess_stateid_op
authorChristoph Hellwig <hch@lst.de>
Thu, 18 Jun 2015 14:45:00 +0000 (16:45 +0200)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 22 Jun 2015 18:15:03 +0000 (14:15 -0400)
commit58f89f4920754ec2043edf25c79591dc309e8d4d
treec213e59eaf06df375269a1471670dc5df201d849
parentccadfb5a4cd2a8316cc0c2bc969fe48691f59bca
nfsd: take struct file setup fully into nfs4_preprocess_stateid_op

This patch changes nfs4_preprocess_stateid_op so it always returns
a valid struct file if it has been asked for that.  For that we
now allocate a temporary struct file for special stateids, and check
permissions if we got the file structure from the stateid.  This
ensures that all callers will get their handling of special stateids
right, and avoids code duplication.

There is a little wart in here because the read code needs to know
if we allocated a file structure so that it can copy around the
read-ahead parameters.  In the long run we should probably aim to
cache full file structures used with special stateids instead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4proc.c
fs/nfsd/nfs4state.c
fs/nfsd/nfs4xdr.c
fs/nfsd/state.h
fs/nfsd/vfs.c
fs/nfsd/vfs.h
fs/nfsd/xdr4.h