Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 807d66d8 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

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: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 25a1a621
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1537,6 +1537,7 @@ static void nfs4_open_done(struct rpc_task *task, void *calldata)
		return;

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