Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-14286 osd-ldiskfs: fallocate() should zero new blocks
[fs/lustre-release.git]
/
lustre
/
tests
/
fsx.c
diff --git
a/lustre/tests/fsx.c
b/lustre/tests/fsx.c
index
36b27f7
..
2f765c0
100644
(file)
--- a/
lustre/tests/fsx.c
+++ b/
lustre/tests/fsx.c
@@
-1530,12
+1530,13
@@
test_fallocate(int mode)
if (!quiet)
warn("%s: filesystem does not support fallocate mode 0x%x, disabling!",
__func__, mode);
if (!quiet)
warn("%s: filesystem does not support fallocate mode 0x%x, disabling!",
__func__, mode);
+ } else {
+ ret = 1;
}
}
- if (ret == 0 && ftruncate(fd, 0) == -1) {
- ret = 1;
+ /* Call truncate only when fallocate succeeds */
+ if (ret == 1 && ftruncate(fd, 0) == -1)
warn("ftruncate to 0 size failed");
warn("ftruncate to 0 size failed");
- }
}
return ret;
}
}
return ret;
}