xfs_admin: get/set label of mounted filesystem
PATCH 1/1 xfs_admin: get/set label of mounted filesystem
Adapt this tool to call xfs_io to get/set the label of a mounted filesystem.
--- db/xfs_admin.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
db/xfs_admin.sh +6 -3
@@ -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
@@ -69,7 +71,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.25.1
Quoted 26 lines · Catherine Hoang
Adapt this tool to call
xfs_ioto get/set the label of a mounted filesystem.Signed-off-by Catherine Hoang <[email protected]>--- db/xfs_admin.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)db/xfs_admin.sh +4
-2@@ -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
db/xfs_admin.sh case $# in · line 75
Quoted 6 lines
db/xfs_admin.sh +2
-1@@ -69,7 +71,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 $?
I'm curious, why did this change from exec to eval+exit?
Otherwise, this looks good to me.
--D
Quoted 6 lines
db/xfs_admin.sh +0
-0fi fiSignature · 1 line
2.25.1
Quoted 31 lines · Darrick J. Wong
Quoted 28 lines · Catherine Hoang
Adapt this tool to call
xfs_ioto get/set the label of a mounted filesystem.Signed-off-by Catherine Hoang <[email protected]>---
db/xfs_admin.sh| 9 ++++++---1 file changed, 6 insertions(+), 3 deletions(-)db/xfs_admin.sh +4
-2@@ -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@@ -69,7 +71,8 @@ case $# in fi
Quoted 6 lines
db/xfs_admin.sh case $# in · line 75
Quoted 4 lines
db/xfs_admin.sh +2
-1if [ -n "$IO_OPTS" ]; then - exec xfs_io -p xfs_admin $IO_OPTS "$mntpt" + eval xfs_io -p xfs_admin $IO_OPTS "$mntpt" + exit $?I'm curious, why did this change from exec to eval+exit?
For some reason exec doesn’t correctly parse the $IO_OPTS arguments. I get this error when using exec:
# xfs_admin -L test /dev/sda2 test': No such file or directory
Quoted 11 lines
Otherwise, this looks good to me.
--D
Quoted 6 lines
db/xfs_admin.sh +0
-0fi fiSignature · 1 line
2.25.1
Quoted 42 lines · Catherine Hoang
Quoted 33 lines
On Jan 17, 2023, at 7:54 PM, Darrick J. Wong <[email protected]> wrote:
Quoted 29 lines · Catherine Hoang
Adapt this tool to call
xfs_ioto get/set the label of a mounted filesystem.Signed-off-by Catherine Hoang <[email protected]>---
db/xfs_admin.sh| 9 ++++++---1 file changed, 6 insertions(+), 3 deletions(-)db/xfs_admin.sh +0
-0@@ -29,9 +29,11 @@ doj) 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=1db/xfs_admin.sh +0
-0@@ -69,7 +71,8 @@ case $# infi
Quoted 8 lines
Quoted 6 lines
if [ -n "$IO_OPTS" ]; then
- execxfs_io-pxfs_admin$IO_OPTS "$mntpt"
+ evalxfs_io-pxfs_admin$IO_OPTS "$mntpt"
+ exit $?I'm curious, why did this change from exec to eval+exit?
Quoted 2 lines
For some reason exec doesn’t correctly parse the $IO_OPTS arguments. I get this error when using exec:
Did some poking around with this. I think you need "$IO_OPTS" to be in quotations like "$mntpt" is. Otherwise the parameters of "label -s test" get separated and passed to xfs_io instead of xfs_admin. It doesnt complain about -s, which it interprets as sync, and "test" becomes the mount point, which of course does not exist.
It doesnt look like your UUID set has merged, which is where the above line of code first appears. And it looks like this patch cannot apply cleanly without it. So I think the cleanest solution might be to fix the quotations in "xfs_io: add fsuuid command", and then add this patch to that set. Maybe just adapt the series title to "xfsprogs: get UUID and label of mounted filesystems".
Otherwise the set is looking really good :-)
Allison
Quoted 15 lines
# xfs_admin -L test /dev/sda2 test': No such file or directoryQuoted 11 lines
Otherwise, this looks good to me.
--D
Quoted 6 lines
fi
fiSignature · 1 line
2.25.1
Quoted 53 lines · Allison Henderson
Quoted 42 lines · Catherine Hoang
Quoted 33 lines
On Jan 17, 2023, at 7:54 PM, Darrick J. Wong <[email protected]> wrote:
Quoted 29 lines · Catherine Hoang
Adapt this tool to call
xfs_ioto get/set the label of a mounted filesystem.Signed-off-by Catherine Hoang <[email protected]>---
db/xfs_admin.sh| 9 ++++++---1 file changed, 6 insertions(+), 3 deletions(-)db/xfs_admin.sh +4
-2@@ -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@@ -69,7 +71,8 @@ case $# in fiQuoted 8 lines
Quoted 6 lines
db/xfs_admin.sh +0
-1if [ -n "$IO_OPTS" ]; then - exec xfs_io -p xfs_admin $IO_OPTS"$mntpt"
+ evalxfs_io-pxfs_admin$IO_OPTS
"$mntpt"
+ exit $?I'm curious, why did this change from exec to eval+exit?
Quoted 2 lines
For some reason exec doesn’t correctly parse the $IO_OPTS arguments. I get this error when using exec:
Did some poking around with this. I think you need "$IO_OPTS" to be in quotations like "$mntpt" is. Otherwise the parameters of "label -s test" get separated and passed to
xfs_ioinstead ofxfs_admin. It doesnt complain about -s, which it interprets as sync, and "test" becomes the mount point, which of course does not exist.
Quoted 6 lines
It doesnt look like your UUID set has merged, which is where the above line of code first appears. And it looks like this patch cannot apply cleanly without it. So I think the cleanest solution might be to fix the quotations in "
xfs_io: add fsuuid command", and then add this patch to that set. Maybe just adapt the series title to "xfsprogs: get UUID and label of mounted filesystems".
Ah that makes sense, thank you! I’ll send out a new patchset with the changes.
Quoted 17 lines
Otherwise the set is looking really good :-)
AllisonQuoted 13 lines
# xfs_admin -L test /dev/sda2 test': No such file or directoryQuoted 10 lines
Otherwise, this looks good to me.
--D
Quoted 5 lines
fi
fiSignature · 1 line
2.25.1