Skip to contentSkip to conversation

xfs_admin: don't add '=1' when building repair command line for -O

PATCH In review Darrick J. Wong 2 participants 2 messages Mar 3, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs_admin: don't add '=1' when building repair command line for -O

From: Darrick J. Wong <[email protected]>

Geert Hendrickx reported an inconsistency between the xfs_admin manpage and its behavior -- the documentation says that users must provide the status explicitly, but the script injects '=1' anyway. While this seems to work with the glibc getsubopt, it's a bit ugly and isn't consistent with the docs.

So, get rid of that extra two bytes.

---
 db/xfs_admin.sh |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
db/xfs_admin.sh +1 -1
index 7a467dbe..02f34b73 100755
@@ -20,7 +20,7 @@ do
 	j)	DB_OPTS=$DB_OPTS" -c 'version log2'";;
 	l)	DB_OPTS=$DB_OPTS" -r -c label";;
 	L)	DB_OPTS=$DB_OPTS" -c 'label "$OPTARG"'";;
-	O)	REPAIR_OPTS=$REPAIR_OPTS" -c $OPTARG=1";;
+	O)	REPAIR_OPTS=$REPAIR_OPTS" -c $OPTARG";;
 	p)	DB_OPTS=$DB_OPTS" -c 'version projid32bit'";;
 	r)	REPAIR_DEV_OPTS=" -r '$OPTARG'";;
 	u)	DB_OPTS=$DB_OPTS" -r -c uuid";;
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

Geert Hendrickx reported an inconsistency between the xfs_admin manpage and its behavior -- the documentation says that users must provide the status explicitly, but the script injects '=1' anyway. While this seems to work with the glibc getsubopt, it's a bit ugly and isn't consistent with the docs.

So, get rid of that extra two bytes.

Neato! Nice catch, Geert, thanks.

Quoted 20 lines
---
 db/xfs_admin.sh |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
db/xfs_admin.sh +1 -1
index 7a467dbe..02f34b73 100755
@@ -20,7 +20,7 @@ do
 	j)	DB_OPTS=$DB_OPTS" -c 'version log2'";;
 	l)	DB_OPTS=$DB_OPTS" -r -c label";;
 	L)	DB_OPTS=$DB_OPTS" -c 'label "$OPTARG"'";;
-	O)	REPAIR_OPTS=$REPAIR_OPTS" -c $OPTARG=1";;
+	O)	REPAIR_OPTS=$REPAIR_OPTS" -c $OPTARG";;
 	p)	DB_OPTS=$DB_OPTS" -c 'version projid32bit'";;
 	r)	REPAIR_DEV_OPTS=" -r '$OPTARG'";;
 	u)	DB_OPTS=$DB_OPTS" -r -c uuid";;