Codex complains that the "media error at data offset..." message prints
the wrong information -- err_off is the offset into @map, not the file
offset; and the length should be constrained by the end of @map. Fix
both of these issues.
Cc: linux-xfs@vger.kernel.org # v4.15.0
Fixes: b364a9c008fc04 ("xfs_scrub: scrub file data blocks")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
char buf[DESCR_BUFSZ];
struct ioerr_filerange *fr = arg;
uint64_t err_off;
+ uint64_t err_len;
int ret;
/* Don't care about unwritten extents. */
return 0;
}
+ err_len = min(fr->physical + fr->length,
+ map->fmr_physical + map->fmr_length) -
+ max(fr->physical, map->fmr_physical);
str_unfixable_error(ctx, buf,
_("media error at data offset %llu length %llu."),
- err_off, fr->length);
+ map->fmr_offset + err_off, err_len);
return 0;
}