[PATCH v2 1/5] common/btrfs: fix awk field separator in _check_temp_fsid

Johannes Thumshirn <[email protected]>
Newsgroups org.kernel.vger.linux-btrfs,org.kernel.vger.fstests
Message-ID <[email protected]>
_check_temp_fsid() extracted the on-disk fsid with "awk -d\" \"",
but -d is gawk's --dump-variables option, not a field separator.
As a result awk tried to open a file named " " for writing and dumped
its variable list, polluting the test output with messages like:

  awk: warning: could not open ' ' for writing: Read-only file system
  awk: warning: sending variable list to standard error
  ARGC: 1
  ARGIND: 0
  ...

which made btrfs/311 (the only test currently exercising this helper)
fail. Use -F" " to set the field separator as intended.

Signed-off-by: Johannes Thumshirn <[email protected]>
---
 common/btrfs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/btrfs b/common/btrfs
index fb7c8378..926f56e5 100644
--- a/common/btrfs
+++ b/common/btrfs
@@ -1014,7 +1014,7 @@ _check_temp_fsid()
 
 	# on disk fsid
 	fsid=$($BTRFS_UTIL_PROG inspect-internal dump-super $dev1 | \
-				grep ^fsid | $AWK_PROG -d" " '{print $2}')
+				grep ^fsid | $AWK_PROG -F" " '{print $2}')
 	echo -e "On disk fsid:\t\t$fsid" | sed -e "s/$fsid/FSID/g"
 
 	# Print FSID even if it is not the same as metadata_uuid because it has
-- 
2.55.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.