mirror of
https://github.com/versity/scoutfs.git
synced 2026-01-05 11:45:09 +00:00
There's filefrag already, and that works, but, it's output is very inconsistent between various OS release versions, and it has already meant that we'd needed to adjust tests to account for these little but insignificant changes. A lot more work than useful. It's even more changed in el9. This adds `scoutfs get-fiemap FILE` and prints out block extent info with flags that we care about as an abbreviated letter: U for Unwritten, L for Last, and O for Unknown (as in, "offline"). The -P/--physical and -L/--logical options turn off logical or physical offset display, in case you only want to see the offsets in either units. You can pass -b/--byte to display offsets and lengths in byte values. The block size will then be obtained from fstat() of the queried file (4096 for scoutfs). I've removed all uses of filefrag from our scoutfs tests. Xfstests still calls it but their internal diff takes care of that issue. Where needed and appropriate, the tests are adjusted so that the output of `scoutfs get-fiemap` is as close as it can to what it used to be, so that reading the test results allows the quick view of what might have been going wrong. There are some output strings I have not bothered to update because there's no real value to updating every output string to match, and we just adjust the golden file accordingly. Signed-off-by: Auke Kok <auke.kok@versity.com>
30 lines
1.2 KiB
Plaintext
30 lines
1.2 KiB
Plaintext
== 0 data_version arg fails
|
|
setattr: data version must not be 0
|
|
Try `setattr --help' or `setattr --usage' for more information.
|
|
== args must specify size and offline
|
|
setattr: must provide size if using --offline option
|
|
Try `setattr --help' or `setattr --usage' for more information.
|
|
== only works on regular files
|
|
failed to open '/mnt/test/test/setattr_more/dir': Is a directory (21)
|
|
scoutfs: setattr failed: Is a directory (21)
|
|
setattr_more ioctl failed on '/mnt/test/test/setattr_more/char': Inappropriate ioctl for device (25)
|
|
scoutfs: setattr failed: Inappropriate ioctl for device (25)
|
|
== non-zero file size fails
|
|
setattr_more ioctl failed on '/mnt/test/test/setattr_more/file': Invalid argument (22)
|
|
scoutfs: setattr failed: Invalid argument (22)
|
|
== non-zero file data_version fails
|
|
setattr_more ioctl failed on '/mnt/test/test/setattr_more/file': Invalid argument (22)
|
|
scoutfs: setattr failed: Invalid argument (22)
|
|
== large size is set
|
|
578437695752307201
|
|
== large data_version is set
|
|
578437695752307201
|
|
== large ctime is set
|
|
1972-02-19 00:06:25.999999999 +0000
|
|
== large offline extents are created
|
|
0: offset: 0 0 length: 10007 flags: O.L
|
|
extents: 1
|
|
== correct offline extent length
|
|
976563
|
|
== omitting data_version should not fail
|