From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752811AbcFFD3V (ORCPT ); Sun, 5 Jun 2016 23:29:21 -0400 Received: from linuxhacker.ru ([217.76.32.60]:54488 "EHLO fiona.linuxhacker.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752014AbcFFD3T (ORCPT ); Sun, 5 Jun 2016 23:29:19 -0400 From: green@linuxhacker.ru To: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger Cc: Linux Kernel Mailing List , Lustre Development List , Jinshan Xiong , Oleg Drokin Subject: [PATCH 1/4] staging/lustre/lov: calculate file offset correctly Date: Sun, 5 Jun 2016 23:28:50 -0400 Message-Id: <1465183733-3147667-2-git-send-email-green@linuxhacker.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1465183733-3147667-1-git-send-email-green@linuxhacker.ru> References: <1465183733-3147667-1-git-send-email-green@linuxhacker.ru> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jinshan Xiong 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 Reviewed-on: http://review.whamcloud.com/14462 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6482 Reviewed-by: Bobi Jam Reviewed-by: Andreas Dilger Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/lov/lov_offset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/lov/lov_offset.c b/drivers/staging/lustre/lustre/lov/lov_offset.c index 9302f06..7636bfa 100644 --- a/drivers/staging/lustre/lustre/lov/lov_offset.c +++ b/drivers/staging/lustre/lustre/lov/lov_offset.c @@ -74,7 +74,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_SHIFT, stripe); + offset = lov_stripe_size(lsm, (stripe_index << PAGE_SHIFT) + 1, stripe); return offset >> PAGE_SHIFT; } -- 2.7.4