nfs: save server READ/WRITE/COMMIT status
Flexfiles layout would want to use them to report DS IO status. Signed-off-by: Peng Tao <tao.peng@primarydata.com> Signed-off-by: Tom Haynes <Thomas.Haynes@primarydata.com>
This commit is contained in:
@@ -481,7 +481,8 @@ out_overflow:
|
||||
* void;
|
||||
* };
|
||||
*/
|
||||
static int decode_attrstat(struct xdr_stream *xdr, struct nfs_fattr *result)
|
||||
static int decode_attrstat(struct xdr_stream *xdr, struct nfs_fattr *result,
|
||||
__u32 *op_status)
|
||||
{
|
||||
enum nfs_stat status;
|
||||
int error;
|
||||
@@ -489,6 +490,8 @@ static int decode_attrstat(struct xdr_stream *xdr, struct nfs_fattr *result)
|
||||
error = decode_stat(xdr, &status);
|
||||
if (unlikely(error))
|
||||
goto out;
|
||||
if (op_status)
|
||||
*op_status = status;
|
||||
if (status != NFS_OK)
|
||||
goto out_default;
|
||||
error = decode_fattr(xdr, result);
|
||||
@@ -808,7 +811,7 @@ out_default:
|
||||
static int nfs2_xdr_dec_attrstat(struct rpc_rqst *req, struct xdr_stream *xdr,
|
||||
struct nfs_fattr *result)
|
||||
{
|
||||
return decode_attrstat(xdr, result);
|
||||
return decode_attrstat(xdr, result, NULL);
|
||||
}
|
||||
|
||||
static int nfs2_xdr_dec_diropres(struct rpc_rqst *req, struct xdr_stream *xdr,
|
||||
@@ -865,6 +868,7 @@ static int nfs2_xdr_dec_readres(struct rpc_rqst *req, struct xdr_stream *xdr,
|
||||
error = decode_stat(xdr, &status);
|
||||
if (unlikely(error))
|
||||
goto out;
|
||||
result->op_status = status;
|
||||
if (status != NFS_OK)
|
||||
goto out_default;
|
||||
error = decode_fattr(xdr, result->fattr);
|
||||
@@ -882,7 +886,7 @@ static int nfs2_xdr_dec_writeres(struct rpc_rqst *req, struct xdr_stream *xdr,
|
||||
{
|
||||
/* All NFSv2 writes are "file sync" writes */
|
||||
result->verf->committed = NFS_FILE_SYNC;
|
||||
return decode_attrstat(xdr, result->fattr);
|
||||
return decode_attrstat(xdr, result->fattr, &result->op_status);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user