]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfs/019: test reserved file support
authorDarrick J. Wong <djwong@kernel.org>
Thu, 20 Feb 2025 21:47:04 +0000 (13:47 -0800)
committerZorro Lang <zlang@kernel.org>
Thu, 6 Mar 2025 13:25:55 +0000 (21:25 +0800)
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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/xfs/019
tests/xfs/019.out

index b30116560c7c4044583e3847a7c16984f4deabf1..5804ef228bd9d2a2a391b7d74fa8437b49d7aa3a 100755 (executable)
@@ -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 \
index 9db157f9b413b9b6896b1dfbf53ac0f784eacf03..9fd3b577e1ab949a5c172c09d4133f7b47889708 100644 (file)
@@ -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)