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

Commit eda3cef8 authored by Trond Myklebust's avatar Trond Myklebust Committed by Linus Torvalds
Browse files

[PATCH] NFS: Fix error handling in nfs_direct_write_result()



If the RPC call tanked, we should not be checking the return value
of data->res.verf->committed, since it is unlikely to even be
initialised.

Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b6dff26a
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -532,10 +532,12 @@ static void nfs_direct_write_result(struct rpc_task *task, void *calldata)

	spin_lock(&dreq->lock);

	if (likely(status >= 0))
	if (unlikely(status < 0)) {
		dreq->error = status;
		goto out_unlock;
	}

	dreq->count += data->res.count;
	else
		dreq->error = task->tk_status;

	if (data->res.verf->committed != NFS_FILE_SYNC) {
		switch (dreq->flags) {
@@ -550,7 +552,7 @@ static void nfs_direct_write_result(struct rpc_task *task, void *calldata)
				}
		}
	}

out_unlock:
	spin_unlock(&dreq->lock);
}