mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
ltp/fsx: drop caches if we're doing closeopen
fsx has a closeopen option where it will close and then re-open the file. This is handy, but what is really more useful is to drop the file from cache completely, so add a drop_caches into this operation so that the file is read back completely from disk to be really evil. [Eryu: fix drop cache failure number to stay within 190] Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
@@ -1778,10 +1778,14 @@ docloseopen(void)
|
||||
prterr("docloseopen: close");
|
||||
report_failure(180);
|
||||
}
|
||||
if (system("echo 3 > /proc/sys/vm/drop_caches")) {
|
||||
prterr("docloseopen: drop_caches");
|
||||
report_failure(181);
|
||||
}
|
||||
fd = open(fname, O_RDWR|o_direct, 0);
|
||||
if (fd < 0) {
|
||||
prterr("docloseopen: open");
|
||||
report_failure(181);
|
||||
report_failure(182);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user