From: Jinshan Xiong Date: Tue, 14 Apr 2015 21:07:12 +0000 (-0700) Subject: LU-6482 lov: calculate file offset correctly X-Git-Tag: 2.7.53~24 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F62%2F14462%2F3;p=fs%2Flustre-release.git 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 --- 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; }