@@ -1677,7 +1677,7 @@ static int fiemap_for_stripe(const struct lu_env *env, struct cl_object *obj,
if (lun_start == lun_end)
return 0;
- req_fm_len = obd_object_end - lun_start;
+ req_fm_len = obd_object_end - lun_start + 1;
fs->fs_fm->fm_length = 0;
len_mapped_single_call = 0;
@@ -1723,7 +1723,7 @@ static int fiemap_for_stripe(const struct lu_env *env, struct cl_object *obj,
fs->fs_fm->fm_mapped_extents = 1;
fm_ext[0].fe_logical = lun_start;
- fm_ext[0].fe_length = obd_object_end - lun_start;
+ fm_ext[0].fe_length = obd_object_end - lun_start + 1;
fm_ext[0].fe_flags |= FIEMAP_EXTENT_UNKNOWN;
goto inactive_tgt;
@@ -226,6 +226,8 @@ u64 lov_size_to_stripe(struct lov_stripe_md *lsm, int index, u64 file_size,
/* given an extent in an lov and a stripe, calculate the extent of the stripe
* that is contained within the lov extent. this returns true if the given
* stripe does intersect with the lov extent.
+ *
+ * Closed interval [@obd_start, @obd_end] will be returned.
*/
int lov_stripe_intersects(struct lov_stripe_md *lsm, int index, int stripeno,
struct lu_extent *ext, u64 *obd_start, u64 *obd_end)