diff options
author | Amnon Aaronsohn | 2007-04-10 07:05:26 +0200 |
---|---|---|
committer | Trond Myklebust | 2007-05-01 07:17:02 +0200 |
commit | 1a0ba9ae485c5fd17d0bff2f14d9dd75b8985593 (patch) | |
tree | 7ff4d7658ce51b33a23a127dbe848bc076cdf597 /fs/nfs | |
parent | NFS: Fix nfs_set_page_dirty() (diff) | |
download | kernel-qcow2-linux-1a0ba9ae485c5fd17d0bff2f14d9dd75b8985593.tar.gz kernel-qcow2-linux-1a0ba9ae485c5fd17d0bff2f14d9dd75b8985593.tar.xz kernel-qcow2-linux-1a0ba9ae485c5fd17d0bff2f14d9dd75b8985593.zip |
NFS: statfs error-handling fix
The nfs statfs function returns a success code on error, and fills the
output buffer with invalid values. The attached patch makes it return a
correct error code instead.
Signed-off-by: Amnon Aaronsohn <amnonaar@gmail.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(Modified patch to reinstate the dprintk())
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/super.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index f1eae44b9a1a..719464a04dda 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -204,9 +204,9 @@ static int nfs_statfs(struct dentry *dentry, struct kstatfs *buf) lock_kernel(); error = server->nfs_client->rpc_ops->statfs(server, fh, &res); - buf->f_type = NFS_SUPER_MAGIC; if (error < 0) goto out_err; + buf->f_type = NFS_SUPER_MAGIC; /* * Current versions of glibc do not correctly handle the @@ -233,15 +233,14 @@ static int nfs_statfs(struct dentry *dentry, struct kstatfs *buf) buf->f_ffree = res.afiles; buf->f_namelen = server->namelen; - out: + unlock_kernel(); return 0; out_err: dprintk("%s: statfs error = %d\n", __FUNCTION__, -error); - buf->f_bsize = buf->f_blocks = buf->f_bfree = buf->f_bavail = -1; - goto out; - + unlock_kernel(); + return error; } /* |