Whamcloud - gitweb
LU-6482 lov: calculate file offset correctly 62/14462/3
authorJinshan Xiong <jinshan.xiong@intel.com>
Tue, 14 Apr 2015 21:07:12 +0000 (14:07 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 28 Apr 2015 05:23:26 +0000 (05:23 +0000)
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 <jinshan.xiong@intel.com>
Change-Id: I87f33027a835121e7b45687e3642ca50bfbf94da
Reviewed-on: http://review.whamcloud.com/14462
Tested-by: Maloo <hpdd-maloo@intel.com>
Tested-by: Jenkins
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/lov/lov_offset.c

index d325e1c..eeb4747 100644 (file)
@@ -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;
 }