pnfs/blocklayout: correctly decrement extent length
authorChristoph Hellwig <hch@lst.de>
Thu, 21 Aug 2014 16:09:29 +0000 (11:09 -0500)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Wed, 10 Sep 2014 19:47:02 +0000 (12:47 -0700)
commit921b81a8cd5a4acc2a009778d13eedd377362c4c
tree8efd8cfe55fa1e62de0a557c6d3579e99dc240b9
parentbe98fd0ac3dd45c1aa404b101caa37f9b317ab57
pnfs/blocklayout: correctly decrement extent length

When we do non-page sized reads we can underflow the extent_length variable
and read incorrect data.  Fix the extent_length calculation and change to
defensive <= checks for the extent length in the read and write path.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/blocklayout/blocklayout.c