Skip to content

Commit

Permalink
NFSv4: nfs4_open_done first must check that GETATTR decoded a file type
Browse files Browse the repository at this point in the history
...before it can check the validity of that file type.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Oct 3, 2012
1 parent 25a1a62 commit 807d66d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,8 @@ static void nfs4_open_done(struct rpc_task *task, void *calldata)
return;

if (task->tk_status == 0) {
switch (data->o_res.f_attr->mode & S_IFMT) {
if (data->o_res.f_attr->valid & NFS_ATTR_FATTR_TYPE) {
switch (data->o_res.f_attr->mode & S_IFMT) {
case S_IFREG:
break;
case S_IFLNK:
Expand All @@ -1548,6 +1549,7 @@ static void nfs4_open_done(struct rpc_task *task, void *calldata)
break;
default:
data->rpc_status = -ENOTDIR;
}
}
renew_lease(data->o_res.server, data->timestamp);
if (!(data->o_res.rflags & NFS4_OPEN_RESULT_CONFIRM))
Expand Down

0 comments on commit 807d66d

Please sign in to comment.