]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
populate: unexport the metadump description text
authorDarrick J. Wong <djwong@kernel.org>
Tue, 18 Oct 2022 22:45:10 +0000 (15:45 -0700)
committerZorro Lang <zlang@kernel.org>
Fri, 28 Oct 2022 17:52:41 +0000 (01:52 +0800)
Make the variable that holds the contents of the metadump description
file a local variable since we don't need it outside of that function.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/populate

index b2d37b47d8be5f82b1ead4f33b63768881c1590e..58b07e33be602a895741b9814cded37b7328e017 100644 (file)
@@ -901,15 +901,15 @@ _scratch_populate_cached() {
        local meta_tag="$(echo "${meta_descr}" | md5sum - | cut -d ' ' -f 1)"
        local metadump_stem="${TEST_DIR}/__populate.${FSTYP}.${meta_tag}"
 
-       # These variables are shared outside this function
+       # This variable is shared outside this function
        POPULATE_METADUMP="${metadump_stem}.metadump"
-       POPULATE_METADUMP_DESCR="${metadump_stem}.txt"
+       local populate_metadump_descr="${metadump_stem}.txt"
 
        # Don't keep metadata images cached for more 48 hours...
        rm -rf "$(find "${POPULATE_METADUMP}" -mtime +2 2>/dev/null)"
 
        # Throw away cached image if it doesn't match our spec.
-       cmp -s "${POPULATE_METADUMP_DESCR}" <(echo "${meta_descr}") || \
+       cmp -s "${populate_metadump_descr}" <(echo "${meta_descr}") || \
                rm -rf "${POPULATE_METADUMP}"
 
        # Try to restore from the metadump
@@ -918,7 +918,7 @@ _scratch_populate_cached() {
 
        # Oh well, just create one from scratch
        _scratch_mkfs
-       echo "${meta_descr}" > "${POPULATE_METADUMP_DESCR}"
+       echo "${meta_descr}" > "${populate_metadump_descr}"
        case "${FSTYP}" in
        "xfs")
                _scratch_xfs_populate $@