diff options
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r-- | fs/nfs/pnfs.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index c00b673261f9..cd9906415a14 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
@@ -660,6 +660,17 @@ pnfs_layout_process(struct nfs4_layoutget *lgp) | |||
660 | struct inode *ino = lo->plh_inode; | 660 | struct inode *ino = lo->plh_inode; |
661 | int status = 0; | 661 | int status = 0; |
662 | 662 | ||
663 | /* Verify we got what we asked for. | ||
664 | * Note that because the xdr parsing only accepts a single | ||
665 | * element array, this can fail even if the server is behaving | ||
666 | * correctly. | ||
667 | */ | ||
668 | if (lgp->args.range.iomode > res->range.iomode || | ||
669 | res->range.offset != 0 || | ||
670 | res->range.length != NFS4_MAX_UINT64) { | ||
671 | status = -EINVAL; | ||
672 | goto out; | ||
673 | } | ||
663 | /* Inject layout blob into I/O device driver */ | 674 | /* Inject layout blob into I/O device driver */ |
664 | lseg = NFS_SERVER(ino)->pnfs_curr_ld->alloc_lseg(lo, res); | 675 | lseg = NFS_SERVER(ino)->pnfs_curr_ld->alloc_lseg(lo, res); |
665 | if (!lseg || IS_ERR(lseg)) { | 676 | if (!lseg || IS_ERR(lseg)) { |