fsx: add support for integrity check with dm-log-writes target
authorAmir Goldstein <amir73il@gmail.com>
Thu, 7 Sep 2017 07:26:34 +0000 (10:26 +0300)
committerEryu Guan <eguan@redhat.com>
Fri, 8 Sep 2017 03:41:38 +0000 (11:41 +0800)
commit3582f7b1bf009965968f5296ddf64c2abca8dc29
tree62b01d09523d914771655e0d4c7cfa21cafb70d4
parent72da031cc1b195e14d352df61b494f6177005b54
fsx: add support for integrity check with dm-log-writes target

Cherry-picked the relevant fsx bits from commit 70d41e17164b
in Josef Bacik's fstests tree (https://github.com/josefbacik/fstests).
Quoting from Josef's commit message:

  I've rigged up fsx to have an integrity check mode.  Basically it works
  like it normally works, but when it fsync()'s it marks the log with a
  unique mark and dumps it's buffer to a file with the mark in the filename.
  I did this with a system() call simply because it was the fastest.  I can
  link the device-mapper libraries and do it programatically if that would
  be preferred, but this works pretty well.

Signed-off-by: Josef Bacik <jbacik@fb.com>
[Amir:]
- Fix some exit codes
- Require -P dirpath for -i logdev

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
ltp/fsx.c