> On Jan 17, 2023, at 7:54 PM, Darrick J. Wong <djwong@xxxxxxxxxx> wrote: > > On Tue, Jan 17, 2023 at 02:37:43PM -0800, Catherine Hoang wrote: >> Adapt this tool to call xfs_io to get/set the label of a mounted filesystem. >> >> Signed-off-by: Catherine Hoang <catherine.hoang@xxxxxxxxxx> >> --- >> db/xfs_admin.sh | 9 ++++++--- >> 1 file changed, 6 insertions(+), 3 deletions(-) >> >> diff --git a/db/xfs_admin.sh b/db/xfs_admin.sh >> index b73fb3ad..cc650c42 100755 >> --- a/db/xfs_admin.sh >> +++ b/db/xfs_admin.sh >> @@ -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 $? > > 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 > > Otherwise, this looks good to me. > > --D > >> fi >> fi >> >> -- >> 2.25.1 >>