summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorAnthony Iliopoulos <ailiop@suse.com>2024-02-01 17:17:31 +0100
committerZorro Lang <zlang@kernel.org>2024-03-01 19:24:16 +0800
commitcc23dcb3ebe6fe6ab8307da183e660717eea38fc (patch)
tree259ff866768a4732b3a9b1827379858696e2a8e3 /common
parent8c9102789fecb8a393dfa6a7ee1390a26f262c62 (diff)
generic/68[12]: use the dir blocksize for xfs filesystems
The tests are using the filesystem block size for calculating the number of dirents required to fill a 2-block directory. For v4 xfs filesystems formatted with fs blocksize of 512 bytes this is failing, as the tests do not take into account that the directory block size is not always equal to the filesystem block size. As such, the tests never go over quota, and even if they did there is no hard block limit being set (due to 512 / 1024 = 0 calculation in setquota). Use the directory blocksize instead of the filesystem blocksize, when the fstype under test is xfs. Signed-off-by: Anthony Iliopoulos <ailiop@suse.com> Reviewed-by: Andrey Albershteyn <aalbersh@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
Diffstat (limited to 'common')
-rw-r--r--common/rc11
1 files changed, 11 insertions, 0 deletions
diff --git a/common/rc b/common/rc
index b53a1cbb..50dde313 100644
--- a/common/rc
+++ b/common/rc
@@ -4756,6 +4756,17 @@ _get_block_size()
stat -f -c %S $1
}
+# Obtain the directory block size of an fs.
+_get_dir_block_size()
+{
+ case "$FSTYP" in
+ xfs)
+ _xfs_get_dir_blocksize $1 ;;
+ *)
+ _get_block_size $1 ;;
+ esac
+}
+
# Require that the fundamental allocation unit of a file is the same as the
# filesystem block size. The sole parameter must be the root dir of a
# filesystem.