fsstress: fix incorrect if condition check for collapse range mode
[xfstests-dev.git] / ltp / fsstress.c
index 29fc250d1e4c4877ad239aca03aa50c8766da4c6..b56fe5c6a1044cca8c249175c4ad15ad72f969b6 100644 (file)
@@ -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));
        }