Skip to contentSkip to conversation

xfs_admin: get/set label of mounted filesystems

PATCH In review Catherine Hoang 3 participants 7 messages Jan 26, 2023 – Feb 3, 2023

lore
Share & tools
lore
#0 lore raw

v2 cover xfs_admin: get/set label of mounted filesystems

Hi all,

This series enables xfs_admin to get and set the label of online filesystems.

Comments and feedback appreciated!

Catherine

Catherine Hoang (2):
xfs_admin: correctly parse IO_OPTS parameters
xfs_admin: get/set label of mounted filesystem

 db/xfs_admin.sh | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 1/2 xfs_admin: correctly parse IO_OPTS parameters

Change exec to eval so that the IO_OPTS parameters are parsed correctly when the parameters contain quotations.

Fixes e7cd89b2da72 ("xfs_admin: get UUID of mounted filesystem")
---
 db/xfs_admin.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
db/xfs_admin.sh +2 -1
index b73fb3ad..3a7f44ea 100755
@@ -69,7 +69,8 @@ case $# in
 			fi
 
 			if [ -n "$IO_OPTS" ]; then
-				exec xfs_io -p xfs_admin $IO_OPTS "$mntpt"
+				eval xfs_io -p xfs_admin $IO_OPTS "$mntpt"
+				exit $?
 			fi
 		fi
 
Signature · 1 line
2.34.1
Reviewed-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] xfs_admin: correctly parse IO_OPTS parameters

Quoted 6 lines · Catherine Hoang

Change exec to eval so that the IO_OPTS parameters are parsed correctly
when the parameters contain quotations.

Fixes e7cd89b2da72 ("xfs_admin: get UUID of mounted filesystem")

Looks good to me

Quoted 20 lines

---
 db/xfs_admin.sh | 3 ++-

 1 file changed, 2 insertions(+), 1 deletion(-)
db/xfs_admin.sh +0 -0
index b73fb3ad..3a7f44ea 100755
@@ -69,7 +69,8 @@ case $# in

                        fi

                        if [ -n "$IO_OPTS" ]; then
-                               exec xfs_io -p xfs_admin $IO_OPTS "$mntpt"
+                               eval xfs_io -p xfs_admin $IO_OPTS "$mntpt"
+                               exit $?
                        fi
                fi

Reviewed-by on v2 1/2
#3 lore raw

Re: [PATCH v2 1/2] xfs_admin: correctly parse IO_OPTS parameters

In reply to Catherine Hoang
Quoted 5 lines · Catherine Hoang

Change exec to eval so that the IO_OPTS parameters are parsed correctly when the parameters contain quotations.

Fixes e7cd89b2da72 ("xfs_admin: get UUID of mounted filesystem")

Looks good, thanks Catherine..

Quoted 21 lines
---
 db/xfs_admin.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
db/xfs_admin.sh +2 -2
index b73fb3ad..3a7f44ea 100755
@@ -69,7 +69,8 @@ case $# in
 			fi
 
 			if [ -n "$IO_OPTS" ]; then
-				exec xfs_io -p xfs_admin $IO_OPTS "$mntpt"
+				eval xfs_io -p xfs_admin $IO_OPTS "$mntpt"
+				exit $?
 			fi
 		fi
 
--

2.34.1

Signature · 1 line
Carlos Maiolino
#4 lore raw

PATCH v2 2/2 xfs_admin: get/set label of mounted filesystem

In reply to Catherine Hoang

Adapt this tool to call xfs_io to get/set the label of a mounted filesystem.

---
 db/xfs_admin.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
db/xfs_admin.sh +4 -2
index 3a7f44ea..cc650c42 100755
@@ -29,9 +29,11 @@ do
 	j)	DB_OPTS=$DB_OPTS" -c 'version log2'"
 		require_offline=1
 		;;
-	l)	DB_OPTS=$DB_OPTS" -r -c label";;
+	l)	DB_OPTS=$DB_OPTS" -r -c label"
+		IO_OPTS=$IO_OPTS" -r -c label"
+		;;
 	L)	DB_OPTS=$DB_OPTS" -c 'label "$OPTARG"'"
-		require_offline=1
+		IO_OPTS=$IO_OPTS" -c 'label -s "$OPTARG"'"
 		;;
 	O)	REPAIR_OPTS=$REPAIR_OPTS" -c $OPTARG"
 		require_offline=1
Signature · 1 line
2.34.1
Reviewed-by on v2 2/2
#5 lore raw

Re: [PATCH v2 2/2] xfs_admin: get/set label of mounted filesystem

Quoted 4 lines · Catherine Hoang

Adapt this tool to call xfs_io to get/set the label of a mounted filesystem.

Looks good. Thanks Catherine!

Quoted 22 lines

---
 db/xfs_admin.sh | 6 ++++--

 1 file changed, 4 insertions(+), 2 deletions(-)
db/xfs_admin.sh +0 -0
index 3a7f44ea..cc650c42 100755
@@ -29,9 +29,11 @@ do

        j)      DB_OPTS=$DB_OPTS" -c 'version log2'" require_offline=1
                ;;
-       l)      DB_OPTS=$DB_OPTS" -r -c label";; +       l)      DB_OPTS=$DB_OPTS" -r -c label"
+               IO_OPTS=$IO_OPTS" -r -c label"
+               ;;
        L)      DB_OPTS=$DB_OPTS" -c 'label "$OPTARG"'" -               require_offline=1
+               IO_OPTS=$IO_OPTS" -c 'label -s "$OPTARG"'" ;;
        O)      REPAIR_OPTS=$REPAIR_OPTS" -c $OPTARG" require_offline=1

Reviewed-by on v2 2/2
#6 lore raw

Re: [PATCH v2 2/2] xfs_admin: get/set label of mounted filesystem

In reply to Catherine Hoang
Quoted 3 lines · Catherine Hoang

Adapt this tool to call xfs_io to get/set the label of a mounted filesystem.

Looks good, thanks!

Quoted 25 lines
---
 db/xfs_admin.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
db/xfs_admin.sh +4 -3
index 3a7f44ea..cc650c42 100755
@@ -29,9 +29,11 @@ do
 	j)	DB_OPTS=$DB_OPTS" -c 'version log2'"
 		require_offline=1
 		;;
-	l)	DB_OPTS=$DB_OPTS" -r -c label";;
+	l)	DB_OPTS=$DB_OPTS" -r -c label"
+		IO_OPTS=$IO_OPTS" -r -c label"
+		;;
 	L)	DB_OPTS=$DB_OPTS" -c 'label "$OPTARG"'"
-		require_offline=1
+		IO_OPTS=$IO_OPTS" -c 'label -s "$OPTARG"'"
 		;;
 	O)	REPAIR_OPTS=$REPAIR_OPTS" -c $OPTARG"
 		require_offline=1
--

2.34.1

Signature · 1 line
Carlos Maiolino