From: Namjae Jeon Subject: [PATCH] xfstests: fsstress: fix incorrect if condition check for collapse range mode Date: Wed, 30 Apr 2014 19:11:32 +0900 Message-ID: <004401cf645c$8f874710$ae95d530$@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: xfs@oss.sgi.com, linux-fsdevel@vger.kernel.org, Ashish Sangwan To: Dave Chinner Return-path: Received: from mailout2.samsung.com ([203.254.224.25]:11795 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753770AbaD3KLe (ORCPT ); Wed, 30 Apr 2014 06:11:34 -0400 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N4U0004C9N8GG20@mailout2.samsung.com> for linux-fsdevel@vger.kernel.org; Wed, 30 Apr 2014 19:11:32 +0900 (KST) Content-language: ko Sender: linux-fsdevel-owner@vger.kernel.org List-ID: There is if condition to be block aligned for off and len of Collapse range. But off and len for all fallocate opearion can be aligned by incorrect if condition check. Signed-off-by: Namjae Jeon Signed-off-by: Ashish Sangwan --- ltp/fsstress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ltp/fsstress.c b/ltp/fsstress.c index 29fc250..ff9ed12 100644 --- a/ltp/fsstress.c +++ b/ltp/fsstress.c @@ -2230,7 +2230,7 @@ do_fallocate(int opno, long r, int mode) * Collapse range requires off and len to be block aligned, make it * more likely to be the case. */ - if (FALLOC_FL_COLLAPSE_RANGE && (opno % 2)) { + if (mode & FALLOC_FL_COLLAPSE_RANGE && (opno % 2)) { off = ((off + stb.st_blksize - 1) & ~(stb.st_blksize - 1)); len = ((len + stb.st_blksize - 1) & ~(stb.st_blksize - 1)); } -- 1.7.11-rc0