tests: (lsfd::mkfds-inotify) use findmnt(1) instead of stat(1) to get bdev numbers#2683
Merged
karelzak merged 3 commits intoutil-linux:masterfrom Jan 8, 2024
Merged
Conversation
… bdev numbers Close util-linux#2349 stat(2) on some filesystems including btrfs reports a block device number (bdev number) with a offset. On the other hand, "inotify wd" field of /proc/$pid/fdinfo/$fd for an inotify file reports bdev numbers without offsets. The offset caused the failure of lsfd::mkfds-inotify test case on btrfs. Unlike stat(2), findmnt can report bdev numbers without offsets. Signed-off-by: Masatake YAMATO <[email protected]>
Signed-off-by: Masatake YAMATO <[email protected]>
Signed-off-by: Masatake YAMATO <[email protected]>
| if ! mount $IMG $MNTPNT; then | ||
| ts_skip "failed to mount a btrfs image, $IMG to $MNTPNT" | ||
| fi | ||
| trap "umount $MNTPNT; rm -f $IMG" EXIT |
Check warning
Code scanning / shellcheck
Use single quotes, otherwise this expands now rather than when signalled.
| INODES_RAW=$(${TS_CMD_LSFD} --raw -n -o INOTIFY.INODES.RAW -Q "${EXPR}") | ||
| echo "INOTIFY.INODES.RAW": $? | ||
| if [[ "$INODES_RAW" == "${FSTAB}"'\x0a'"${ROOT}" ]]; then | ||
| echo "INOTIFY.INODES.RAW" == FSTAB'\x0a'ROOT |
Check warning
Code scanning / shellcheck
This apostrophe terminated the single quoted string!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close #2349
stat(2) on some filesystems including btrfs reports a block device
number (bdev number) with a offset. On the other hand, "inotify wd"
field of /proc/$pid/fdinfo/$fd for an inotify file reports bdev
numbers without offsets.
The offset caused the failure of lsfd::mkfds-inotify test case on
btrfs. Unlike stat(2), findmnt can report bdev numbers without
offsets.