]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
common: make rt_ops local in _try_scratch_mkfs_sized
authorHans Holmberg <Hans.Holmberg@wdc.com>
Tue, 8 Oct 2024 10:52:04 +0000 (10:52 +0000)
committerZorro Lang <zlang@kernel.org>
Thu, 10 Oct 2024 08:03:40 +0000 (16:03 +0800)
If we call _try_scratch_mkfs_size with $SCRATCH_RTDEV set followed by
a call with $SCRATCH_RTDEV cleared, rt_ops will have stale size
parameters that will cause mkfs.xfs to fail with:
"size specified for non-existent rt subvolume"

Make rt_ops local to fix this.

Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/rc

index 3171058496c732f9a35e8a756ededda6fa7cc931..2af26f23f9b60bb7fe61677e8df9da9a712d35d7 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -1030,6 +1030,7 @@ _try_scratch_mkfs_sized()
        local blocksize=$2
        local def_blksz
        local blocksize_opt
+       local rt_ops
 
        case $FSTYP in
        xfs)