From 375c3219054045d47cffc3664fedceaad47cf894 Mon Sep 17 00:00:00 2001 From: Jinshan Xiong Date: Tue, 14 Apr 2015 14:07:12 -0700 Subject: [PATCH] LU-6482 lov: calculate file offset correctly In lov_stripe_pgoff(), it calls lov_stripe_size() to calculate the file size by ost_size, which will be wrong if the stripe_index happens to be stripe aligned. Signed-off-by: Jinshan Xiong Change-Id: I87f33027a835121e7b45687e3642ca50bfbf94da Reviewed-on: http://review.whamcloud.com/14462 Tested-by: Maloo Tested-by: Jenkins Reviewed-by: Bobi Jam Reviewed-by: Andreas Dilger --- lustre/lov/lov_offset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lustre/lov/lov_offset.c b/lustre/lov/lov_offset.c index d325e1c..eeb4747 100644 --- a/lustre/lov/lov_offset.c +++ b/lustre/lov/lov_offset.c @@ -76,7 +76,7 @@ pgoff_t lov_stripe_pgoff(struct lov_stripe_md *lsm, pgoff_t stripe_index, { loff_t offset; - offset = lov_stripe_size(lsm, stripe_index << PAGE_CACHE_SHIFT, + offset = lov_stripe_size(lsm, (stripe_index << PAGE_CACHE_SHIFT) + 1, stripe); return offset >> PAGE_CACHE_SHIFT; } -- 1.8.3.1