diff options
author | Kinglong Mee <kinglongmee@gmail.com> | 2015-03-19 07:04:41 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2015-03-20 12:43:59 -0400 |
commit | db59c0ef08ca56758dcee6495d9d6a086682c5ec (patch) | |
tree | add6a6bbf355c117f71f81d89458ee5e08dda15d /fs | |
parent | 6f8f28ec5f88715515e70dd52f16b326a5e63f81 (diff) |
NFSD: Take care the return value from nfsd4_decode_stateid
Return status after nfsd4_decode_stateid failed.
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index df5e66caf100..c76654c3605f 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c | |||
@@ -1562,7 +1562,11 @@ nfsd4_decode_layoutget(struct nfsd4_compoundargs *argp, | |||
1562 | p = xdr_decode_hyper(p, &lgp->lg_seg.offset); | 1562 | p = xdr_decode_hyper(p, &lgp->lg_seg.offset); |
1563 | p = xdr_decode_hyper(p, &lgp->lg_seg.length); | 1563 | p = xdr_decode_hyper(p, &lgp->lg_seg.length); |
1564 | p = xdr_decode_hyper(p, &lgp->lg_minlength); | 1564 | p = xdr_decode_hyper(p, &lgp->lg_minlength); |
1565 | nfsd4_decode_stateid(argp, &lgp->lg_sid); | 1565 | |
1566 | status = nfsd4_decode_stateid(argp, &lgp->lg_sid); | ||
1567 | if (status) | ||
1568 | return status; | ||
1569 | |||
1566 | READ_BUF(4); | 1570 | READ_BUF(4); |
1567 | lgp->lg_maxcount = be32_to_cpup(p++); | 1571 | lgp->lg_maxcount = be32_to_cpup(p++); |
1568 | 1572 | ||
@@ -1580,7 +1584,11 @@ nfsd4_decode_layoutcommit(struct nfsd4_compoundargs *argp, | |||
1580 | p = xdr_decode_hyper(p, &lcp->lc_seg.offset); | 1584 | p = xdr_decode_hyper(p, &lcp->lc_seg.offset); |
1581 | p = xdr_decode_hyper(p, &lcp->lc_seg.length); | 1585 | p = xdr_decode_hyper(p, &lcp->lc_seg.length); |
1582 | lcp->lc_reclaim = be32_to_cpup(p++); | 1586 | lcp->lc_reclaim = be32_to_cpup(p++); |
1583 | nfsd4_decode_stateid(argp, &lcp->lc_sid); | 1587 | |
1588 | status = nfsd4_decode_stateid(argp, &lcp->lc_sid); | ||
1589 | if (status) | ||
1590 | return status; | ||
1591 | |||
1584 | READ_BUF(4); | 1592 | READ_BUF(4); |
1585 | lcp->lc_newoffset = be32_to_cpup(p++); | 1593 | lcp->lc_newoffset = be32_to_cpup(p++); |
1586 | if (lcp->lc_newoffset) { | 1594 | if (lcp->lc_newoffset) { |
@@ -1628,7 +1636,11 @@ nfsd4_decode_layoutreturn(struct nfsd4_compoundargs *argp, | |||
1628 | READ_BUF(16); | 1636 | READ_BUF(16); |
1629 | p = xdr_decode_hyper(p, &lrp->lr_seg.offset); | 1637 | p = xdr_decode_hyper(p, &lrp->lr_seg.offset); |
1630 | p = xdr_decode_hyper(p, &lrp->lr_seg.length); | 1638 | p = xdr_decode_hyper(p, &lrp->lr_seg.length); |
1631 | nfsd4_decode_stateid(argp, &lrp->lr_sid); | 1639 | |
1640 | status = nfsd4_decode_stateid(argp, &lrp->lr_sid); | ||
1641 | if (status) | ||
1642 | return status; | ||
1643 | |||
1632 | READ_BUF(4); | 1644 | READ_BUF(4); |
1633 | lrp->lrf_body_len = be32_to_cpup(p++); | 1645 | lrp->lrf_body_len = be32_to_cpup(p++); |
1634 | if (lrp->lrf_body_len > 0) { | 1646 | if (lrp->lrf_body_len > 0) { |