Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61861
b: refs/heads/master
c: 9936781
h: refs/heads/master
i:
  61859: 90f7d15
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Jul 19, 2007
1 parent 1eee67f commit ac2e0c6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 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: 56659e9926ef5996398924c799ecac39ca8b6223
refs/heads/master: 9936781d0147e13cbc6df02f5265e0b9999ce3cf
7 changes: 6 additions & 1 deletion trunk/fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ static int _nfs4_proc_access(struct inode *inode, struct nfs_access_entry *entry
static int nfs4_handle_exception(const struct nfs_server *server, int errorcode, struct nfs4_exception *exception);
static int nfs4_wait_clnt_recover(struct rpc_clnt *clnt, struct nfs_client *clp);
static int _nfs4_do_access(struct inode *inode, struct rpc_cred *cred, int openflags);
static int _nfs4_proc_lookup(struct inode *dir, const struct qstr *name, struct nfs_fh *fhandle, struct nfs_fattr *fattr);
static int _nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fattr *fattr);

/* Prevent leaks of NFSv4 errors into userland */
int nfs4_map_errors(int err)
Expand Down Expand Up @@ -930,6 +932,9 @@ static int _nfs4_proc_open(struct nfs4_opendata *data)
if (status != 0 || !data->rpc_done)
return status;

if (o_res->fh.size == 0)
_nfs4_proc_lookup(dir, o_arg->name, &o_res->fh, o_res->f_attr);

if (o_arg->open_flags & O_CREAT) {
update_changeattr(dir, &o_res->cinfo);
nfs_post_op_update_inode(dir, o_res->dir_attr);
Expand All @@ -941,7 +946,7 @@ static int _nfs4_proc_open(struct nfs4_opendata *data)
return status;
}
if (!(o_res->f_attr->valid & NFS_ATTR_FATTR))
return server->nfs_client->rpc_ops->getattr(server, &o_res->fh, o_res->f_attr);
_nfs4_proc_getattr(server, &o_res->fh, o_res->f_attr);
return 0;
}

Expand Down
8 changes: 4 additions & 4 deletions trunk/fs/nfs/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -3161,11 +3161,12 @@ static int decode_getfh(struct xdr_stream *xdr, struct nfs_fh *fh)
uint32_t len;
int status;

/* Zero handle first to allow comparisons */
memset(fh, 0, sizeof(*fh));

status = decode_op_hdr(xdr, OP_GETFH);
if (status)
return status;
/* Zero handle first to allow comparisons */
memset(fh, 0, sizeof(*fh));

READ_BUF(4);
READ32(len);
Expand Down Expand Up @@ -4030,8 +4031,7 @@ static int nfs4_xdr_dec_open(struct rpc_rqst *rqstp, __be32 *p, struct nfs_openr
status = decode_open(&xdr, res);
if (status)
goto out;
status = decode_getfh(&xdr, &res->fh);
if (status)
if (decode_getfh(&xdr, &res->fh) != 0)
goto out;
if (decode_getfattr(&xdr, res->f_attr, res->server) != 0)
goto out;
Expand Down

0 comments on commit ac2e0c6

Please sign in to comment.