Skip to content

Commit ecd4df4

Browse files
Jinshan Xionggregkh
authored andcommitted
staging/lustre/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 <[email protected]> Reviewed-on: http://review.whamcloud.com/14462 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6482 Reviewed-by: Bobi Jam <[email protected]> Reviewed-by: Andreas Dilger <[email protected]> Signed-off-by: Oleg Drokin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b788dc5 commit ecd4df4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/staging/lustre/lustre/lov/lov_offset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pgoff_t lov_stripe_pgoff(struct lov_stripe_md *lsm, pgoff_t stripe_index,
7474
{
7575
loff_t offset;
7676

77-
offset = lov_stripe_size(lsm, stripe_index << PAGE_SHIFT, stripe);
77+
offset = lov_stripe_size(lsm, (stripe_index << PAGE_SHIFT) + 1, stripe);
7878
return offset >> PAGE_SHIFT;
7979
}
8080

0 commit comments

Comments
 (0)