From: Namjae Jeon Subject: [PATCH v2] xfstests: fsstress: fix incorrect if condition check for collapse range mode Date: Wed, 30 Apr 2014 19:35:11 +0900 Message-ID: <004601cf645f$dd216de0$976449a0$@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, =?iso-8859-2?Q?Luk=E1=B9_Czerner?= , Ashish Sangwan , xfs@oss.sgi.com To: Dave Chinner Return-path: Content-language: ko List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com List-Id: linux-fsdevel.vger.kernel.org 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 Reviewed-by: Lukas Czerner --- 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 _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs