diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-10-02 20:09:00 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-10-02 20:09:00 -0400 |
commit | 807d66d80221920729a8d4abfa04246546a6d3fa (patch) | |
tree | 8e5cdfe1030df602b8cd361c8b4236d9f9534a37 /fs | |
parent | 25a1a6211dd2fcbf0e45a07030703e2a42d7aa87 (diff) |
NFSv4: nfs4_open_done first must check that GETATTR decoded a file type
...before it can check the validity of that file type.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/nfs4proc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 21cfac7c2ff8..68438aa4f08e 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -1537,7 +1537,8 @@ static void nfs4_open_done(struct rpc_task *task, void *calldata) | |||
1537 | return; | 1537 | return; |
1538 | 1538 | ||
1539 | if (task->tk_status == 0) { | 1539 | if (task->tk_status == 0) { |
1540 | switch (data->o_res.f_attr->mode & S_IFMT) { | 1540 | if (data->o_res.f_attr->valid & NFS_ATTR_FATTR_TYPE) { |
1541 | switch (data->o_res.f_attr->mode & S_IFMT) { | ||
1541 | case S_IFREG: | 1542 | case S_IFREG: |
1542 | break; | 1543 | break; |
1543 | case S_IFLNK: | 1544 | case S_IFLNK: |
@@ -1548,6 +1549,7 @@ static void nfs4_open_done(struct rpc_task *task, void *calldata) | |||
1548 | break; | 1549 | break; |
1549 | default: | 1550 | default: |
1550 | data->rpc_status = -ENOTDIR; | 1551 | data->rpc_status = -ENOTDIR; |
1552 | } | ||
1551 | } | 1553 | } |
1552 | renew_lease(data->o_res.server, data->timestamp); | 1554 | renew_lease(data->o_res.server, data->timestamp); |
1553 | if (!(data->o_res.rflags & NFS4_OPEN_RESULT_CONFIRM)) | 1555 | if (!(data->o_res.rflags & NFS4_OPEN_RESULT_CONFIRM)) |