Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Peng Tao and committed by
Tom Haynes
aabff4dd 9bf87482

+15 -3
+7 -3
fs/nfs/nfs2xdr.c
··· 481 481 * void; 482 482 * }; 483 483 */ 484 - static int decode_attrstat(struct xdr_stream *xdr, struct nfs_fattr *result) 484 + static int decode_attrstat(struct xdr_stream *xdr, struct nfs_fattr *result, 485 + __u32 *op_status) 485 486 { 486 487 enum nfs_stat status; 487 488 int error; ··· 490 489 error = decode_stat(xdr, &status); 491 490 if (unlikely(error)) 492 491 goto out; 492 + if (op_status) 493 + *op_status = status; 493 494 if (status != NFS_OK) 494 495 goto out_default; 495 496 error = decode_fattr(xdr, result); ··· 811 808 static int nfs2_xdr_dec_attrstat(struct rpc_rqst *req, struct xdr_stream *xdr, 812 809 struct nfs_fattr *result) 813 810 { 814 - return decode_attrstat(xdr, result); 811 + return decode_attrstat(xdr, result, NULL); 815 812 } 816 813 817 814 static int nfs2_xdr_dec_diropres(struct rpc_rqst *req, struct xdr_stream *xdr, ··· 868 865 error = decode_stat(xdr, &status); 869 866 if (unlikely(error)) 870 867 goto out; 868 + result->op_status = status; 871 869 if (status != NFS_OK) 872 870 goto out_default; 873 871 error = decode_fattr(xdr, result->fattr); ··· 886 882 { 887 883 /* All NFSv2 writes are "file sync" writes */ 888 884 result->verf->committed = NFS_FILE_SYNC; 889 - return decode_attrstat(xdr, result->fattr); 885 + return decode_attrstat(xdr, result->fattr, &result->op_status); 890 886 } 891 887 892 888 /**
+3
fs/nfs/nfs3xdr.c
··· 1636 1636 error = decode_post_op_attr(xdr, result->fattr); 1637 1637 if (unlikely(error)) 1638 1638 goto out; 1639 + result->op_status = status; 1639 1640 if (status != NFS3_OK) 1640 1641 goto out_status; 1641 1642 error = decode_read3resok(xdr, result); ··· 1709 1708 error = decode_wcc_data(xdr, result->fattr); 1710 1709 if (unlikely(error)) 1711 1710 goto out; 1711 + result->op_status = status; 1712 1712 if (status != NFS3_OK) 1713 1713 goto out_status; 1714 1714 error = decode_write3resok(xdr, result); ··· 2325 2323 error = decode_wcc_data(xdr, result->fattr); 2326 2324 if (unlikely(error)) 2327 2325 goto out; 2326 + result->op_status = status; 2328 2327 if (status != NFS3_OK) 2329 2328 goto out_status; 2330 2329 error = decode_writeverf3(xdr, &result->verf->verifier);
+3
fs/nfs/nfs4xdr.c
··· 6567 6567 int status; 6568 6568 6569 6569 status = decode_compound_hdr(xdr, &hdr); 6570 + res->op_status = hdr.status; 6570 6571 if (status) 6571 6572 goto out; 6572 6573 status = decode_sequence(xdr, &res->seq_res, rqstp); ··· 6593 6592 int status; 6594 6593 6595 6594 status = decode_compound_hdr(xdr, &hdr); 6595 + res->op_status = hdr.status; 6596 6596 if (status) 6597 6597 goto out; 6598 6598 status = decode_sequence(xdr, &res->seq_res, rqstp); ··· 6623 6621 int status; 6624 6622 6625 6623 status = decode_compound_hdr(xdr, &hdr); 6624 + res->op_status = hdr.status; 6626 6625 if (status) 6627 6626 goto out; 6628 6627 status = decode_sequence(xdr, &res->seq_res, rqstp);
+2
include/linux/nfs_xdr.h
··· 513 513 struct nfs4_sequence_res seq_res; 514 514 struct nfs_fattr * fattr; 515 515 __u32 count; 516 + __u32 op_status; 516 517 int eof; /* used by read */ 517 518 struct nfs_writeverf * verf; /* used by write */ 518 519 const struct nfs_server *server; /* used by write */ ··· 533 532 534 533 struct nfs_commitres { 535 534 struct nfs4_sequence_res seq_res; 535 + __u32 op_status; 536 536 struct nfs_fattr *fattr; 537 537 struct nfs_writeverf *verf; 538 538 const struct nfs_server *server;