]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfs/841: create a block device that must exist
authorChristoph Hellwig <hch@lst.de>
Mon, 2 Feb 2026 08:57:01 +0000 (09:57 +0100)
committerZorro Lang <zlang@kernel.org>
Tue, 3 Feb 2026 08:29:50 +0000 (16:29 +0800)
This test currently creates a block device node for /dev/ram0,
which isn't guaranteed to exist, and can thus cause the test to
fail with:

mkfs.xfs: cannot open $TEST_DIR/proto/blockdev: No such device or address

Instead, create a node for the backing device for $TEST_DIR, which must
exist.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Luca Di Maio <luca.dimaio1@gmail.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/xfs/841

index ee2368d4a74689c73c1004383783b4fba6f4d54c..ddb1b3bea10492dc9f0c83cf1c6630672c5b5ecf 100755 (executable)
@@ -85,9 +85,12 @@ _create_proto_dir()
        $here/src/af_unix "$PROTO_DIR/socket" 2> /dev/null || true
 
        # Block device (requires root)
-       mknod "$PROTO_DIR/blockdev" b 1 0 2> /dev/null || true
+       # Uses the device for $TEST_DIR to ensure it always exists.
+       mknod "$PROTO_DIR/blockdev" b $(stat -c '%Hd %Ld' $TEST_DIR) \
+               2> /dev/null || true
 
        # Character device (requires root)
+       # Uses /dev/null, which should always exist
        mknod "$PROTO_DIR/chardev" c 1 3 2> /dev/null || true
 }