提交 eda3cef8 编写于 作者: T Trond Myklebust 提交者: Linus Torvalds

[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: NTrond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 b6dff26a
......@@ -532,10 +532,12 @@ static void nfs_direct_write_result(struct rpc_task *task, void *calldata)
spin_lock(&dreq->lock);
if (likely(status >= 0))
dreq->count += data->res.count;
else
dreq->error = task->tk_status;
if (unlikely(status < 0)) {
dreq->error = status;
goto out_unlock;
}
dreq->count += data->res.count;
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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册