diff mbox series

[2/4] xfs/019: test reserved file support

Message ID 173992588687.4079248.1375034459997008677.stgit@frogsfrogsfrogs (mailing list archive)
State New
Headers show
Series [1/4] xfs/019: reduce _fail calls in test | expand

Commit Message

Darrick J. Wong Feb. 19, 2025, 12:57 a.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Test creating files with preallocated blocks but a file size of zero,
since mkfs' protofile parser supports creating such things.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
 tests/xfs/019     |    5 +++++
 tests/xfs/019.out |    5 +++++
 2 files changed, 10 insertions(+)

Comments

Christoph Hellwig Feb. 19, 2025, 6:09 a.m. UTC | #1
Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/tests/xfs/019 b/tests/xfs/019
index b30116560c7c40..5804ef228bd9d2 100755
--- a/tests/xfs/019
+++ b/tests/xfs/019
@@ -82,6 +82,7 @@  pipe p--670 0 0
 symlink l--123 0 0 bigfile
 : a file we actually read
 bigfile ---666 3 0 $tempfile.2
+rsvfile r--666 3 0 1234567
 : done
 $
 EOF
@@ -117,6 +118,10 @@  _verify_fs()
 	diff -q $SCRATCH_MNT/symlink $tempfile.2 \
 		|| echo "symlink broken"
 
+	rsvblocks=$(stat -c '%b' $SCRATCH_MNT/rsvfile)
+	test $rsvblocks -gt 0 \
+		|| echo "rsvfile broken"
+
 	echo "*** unmount FS"
 	_full "umount"
 	_scratch_unmount >>$seqfull 2>&1 \
diff --git a/tests/xfs/019.out b/tests/xfs/019.out
index 9db157f9b413b9..9fd3b577e1ab94 100644
--- a/tests/xfs/019.out
+++ b/tests/xfs/019.out
@@ -69,6 +69,11 @@  Device: <DEVICE> Inode: <INODE> Links: 1
  Mode: (0670/frw-rwx---) Uid: (0) Gid: (0)
 Device: <DEVICE> Inode: <INODE> Links: 1 
 
+ File: "./rsvfile"
+ Size: 0 Filetype: Regular File
+ Mode: (0666/-rw-rw-rw-) Uid: (3) Gid: (0)
+Device: <DEVICE> Inode: <INODE> Links: 1 
+
  File: "./setgid"
  Size: 5 Filetype: Regular File
  Mode: (2666/-rw-rwsrw-) Uid: (0) Gid: (0)