LU-4619 llite: prevent buffer overflow in fiemap
lov_fiemap() does not take consider its @vallen parameter, which is
the max buffer size the caller can hold for the fiemap extents.
This patch fixes this and limits the max mapped fiemap extent count
to fit in the preallocted buffer.
This patch also fixes a memory out of bound write issue when the
fiemap call is only for detecting the number of existing extent.
Lustre-commit:
19326174e264802b91fb4dfc0c1ea16d8bf3ef7e
Lustre-change: http://review.whamcloud.com/9834
Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Change-Id: Ia5aadfa38c3a3d12cdb6e0773ebffb6e213a9abf
Reviewed-on: http://review.whamcloud.com/10408
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>