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>
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);
}
}