From 9fa2c6af89cc86e33154458db395825ca9482de4 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 21 Jan 2022 16:26:35 -0800 Subject: [PATCH] Use get-allocated-inos in orphan-inodes test The orphan inodes test needs to test if inode items exist as it manipulates inodes. It used to open the inode by a handle but we're fixing that to not allow opening unlinked files. The get-allocated-inos ioctl tests for the presence of items owned by the inode regardless of any other vfs state so we can use it to verify what scoutfs is doing as we work with the vfs inodes. Signed-off-by: Zach Brown --- tests/tests/orphan-inodes.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/tests/orphan-inodes.sh b/tests/tests/orphan-inodes.sh index bc55d35b..ffd9f498 100644 --- a/tests/tests/orphan-inodes.sh +++ b/tests/tests/orphan-inodes.sh @@ -26,7 +26,8 @@ inode_exists() { local ino="$1" - handle_cat "$T_M0" "$ino" > "$T_TMP.handle_cat.log" 2>&1 + scoutfs get-allocated-inos -i "$ino" -s -p "$T_M0" > $T_TMP.inos.log 2>&1 + test "$?" == 0 -a "$(head -1 $T_TMP.inos.log)" == "$ino" } echo "== test our inode existance function"