Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 98404
b: refs/heads/master
c: b7e2445
h: refs/heads/master
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Jun 23, 2008
1 parent 0fd6f48 commit 48414a0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 33852a1f2bb014e4047a844556c0d76a2f790c37
refs/heads/master: b7e2445737ff69cef892b6fd9cd71cae2c9e9515
5 changes: 3 additions & 2 deletions trunk/fs/nfs/mount_clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,11 @@ static int xdr_decode_fhstatus3(struct rpc_rqst *req, __be32 *p,
struct mnt_fhstatus *res)
{
struct nfs_fh *fh = res->fh;
unsigned size;

if ((res->status = ntohl(*p++)) == 0) {
int size = ntohl(*p++);
if (size <= NFS3_FHSIZE) {
size = ntohl(*p++);
if (size <= NFS3_FHSIZE && size != 0) {
fh->size = size;
memcpy(fh->data, p, size);
} else
Expand Down
8 changes: 4 additions & 4 deletions trunk/fs/nfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1249,13 +1249,13 @@ static int nfs_validate_mount_data(void *options,
case 5:
memset(data->context, 0, sizeof(data->context));
case 6:
if (data->flags & NFS_MOUNT_VER3)
if (data->flags & NFS_MOUNT_VER3) {
if (data->root.size > NFS3_FHSIZE || data->root.size == 0)
goto out_invalid_fh;
mntfh->size = data->root.size;
else
} else
mntfh->size = NFS2_FHSIZE;

if (mntfh->size > sizeof(mntfh->data))
goto out_invalid_fh;

memcpy(mntfh->data, data->root.data, mntfh->size);
if (mntfh->size < sizeof(mntfh->data))
Expand Down

0 comments on commit 48414a0

Please sign in to comment.