|
@@ -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)
|
|
@@ -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);
|
|
@@ -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;
|
|
|
}
|
|
|
|