summaryrefslogtreecommitdiff
path: root/fs/nfsd/vfs.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-28 14:05:55 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-28 14:05:55 -0700
commit2547d1d20f3a252567f974de8ce1c572a0815d5a (patch)
tree786404cb38c6ca55ca46a63df570c119ca32561e /fs/nfsd/vfs.c
parent7be0d4f90ad8e0f9591fd311765a212a42e26b13 (diff)
parentf6360efb83cd6dd1476cd758834c8277508c1f15 (diff)
downloadlinux-3.10-2547d1d20f3a252567f974de8ce1c572a0815d5a.tar.gz
linux-3.10-2547d1d20f3a252567f974de8ce1c572a0815d5a.tar.bz2
linux-3.10-2547d1d20f3a252567f974de8ce1c572a0815d5a.zip
Merge branch 'for-2.6.36' of git://linux-nfs.org/~bfields/linux
* 'for-2.6.36' of git://linux-nfs.org/~bfields/linux: nfsd: fix NULL dereference in nfsd_statfs() nfsd4: fix downgrade/lock logic nfsd4: typo fix in find_any_file nfsd4: bad BUG() in preprocess_stateid_op
Diffstat (limited to 'fs/nfsd/vfs.c')
-rw-r--r--fs/nfsd/vfs.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 96360a83cb9..661a6cf8e82 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -2033,15 +2033,17 @@ out:
__be32
nfsd_statfs(struct svc_rqst *rqstp, struct svc_fh *fhp, struct kstatfs *stat, int access)
{
- struct path path = {
- .mnt = fhp->fh_export->ex_path.mnt,
- .dentry = fhp->fh_dentry,
- };
__be32 err;
err = fh_verify(rqstp, fhp, 0, NFSD_MAY_NOP | access);
- if (!err && vfs_statfs(&path, stat))
- err = nfserr_io;
+ if (!err) {
+ struct path path = {
+ .mnt = fhp->fh_export->ex_path.mnt,
+ .dentry = fhp->fh_dentry,
+ };
+ if (vfs_statfs(&path, stat))
+ err = nfserr_io;
+ }
return err;
}