All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: guaneryu@gmail.com, zlang@redhat.com
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me
Subject: [PATCH v1.1 1/5] populate: export the metadump description name
Date: Fri, 14 Oct 2022 11:21:55 -0700	[thread overview]
Message-ID: <Y0mowyuRHSivs3ho@magnolia> (raw)
In-Reply-To: <166553912788.422450.6797363004980943410.stgit@magnolia>

From: Darrick J. Wong <djwong@kernel.org>

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>
---
v1.1: dont export POPULATE_METADUMP; change the description a bit
---
 common/populate |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/populate b/common/populate
index cfdaf766f0..ba34ca5844 100644
--- a/common/populate
+++ b/common/populate
@@ -868,15 +868,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
@@ -885,7 +885,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 $@

  parent reply	other threads:[~2022-10-14 18:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-12  1:45 [PATCHSET 0/5] fstests: support external logs when caching prepopulated images Darrick J. Wong
2022-10-12  1:45 ` [PATCH 1/5] populate: export the metadump description name Darrick J. Wong
2022-10-13 14:55   ` Zorro Lang
2022-10-13 15:54     ` Darrick J. Wong
2022-10-13 16:28       ` Zorro Lang
2022-10-13 19:12         ` Darrick J. Wong
2022-10-14  1:17           ` Zorro Lang
2022-10-14 18:21   ` Darrick J. Wong [this message]
2022-10-15  5:01     ` [PATCH v1.1 " Zorro Lang
2022-10-15  5:10       ` Zorro Lang
2022-10-15  7:28         ` Darrick J. Wong
2022-10-15  8:21           ` Zorro Lang
2022-10-15  7:23       ` Darrick J. Wong
2022-10-12  1:45 ` [PATCH 2/5] populate: wipe external xfs log devices when restoring a cached image Darrick J. Wong
2022-10-13 15:10   ` Zorro Lang
2022-10-12  1:45 ` [PATCH 3/5] populate: reformat external ext[34] journal " Darrick J. Wong
2022-10-13 15:47   ` Zorro Lang
2022-10-12  1:45 ` [PATCH 4/5] populate: require e2image before populating Darrick J. Wong
2022-10-13 15:48   ` Zorro Lang
2022-10-12  1:45 ` [PATCH 5/5] fstests: refactor xfs_mdrestore calls Darrick J. Wong
2022-10-13 16:06   ` Zorro Lang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y0mowyuRHSivs3ho@magnolia \
    --to=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=guan@eryu.me \
    --cc=guaneryu@gmail.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=zlang@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.