]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_admin: support filesystems with realtime devices
authorDarrick J. Wong <djwong@kernel.org>
Wed, 24 Feb 2021 00:09:28 +0000 (19:09 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Wed, 24 Feb 2021 00:09:28 +0000 (19:09 -0500)
Add a -r option to xfs_admin so that we can pass the name of the
realtime device to xfs_repair.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
db/xfs_admin.sh
man/man8/xfs_admin.8

index 71a9aa98f66243794b69715590afecd99600c5dd..430872efa0f1e379021719b4f7bac70ba7479161 100755 (executable)
@@ -7,9 +7,10 @@
 status=0
 DB_OPTS=""
 REPAIR_OPTS=""
-USAGE="Usage: xfs_admin [-efjlpuV] [-c 0|1] [-L label] [-U uuid] device [logdev]"
+REPAIR_DEV_OPTS=""
+USAGE="Usage: xfs_admin [-efjlpuV] [-c 0|1] [-L label] [-r rtdev] [-U uuid] device [logdev]"
 
-while getopts "efjlpuc:L:U:V" c
+while getopts "c:efjlL:pr:uU:V" c
 do
        case $c in
        c)      REPAIR_OPTS=$REPAIR_OPTS" -c lazycount="$OPTARG;;
@@ -19,6 +20,7 @@ do
        l)      DB_OPTS=$DB_OPTS" -r -c label";;
        L)      DB_OPTS=$DB_OPTS" -c 'label "$OPTARG"'";;
        p)      DB_OPTS=$DB_OPTS" -c 'version projid32bit'";;
+       r)      REPAIR_DEV_OPTS=" -r '$OPTARG'";;
        u)      DB_OPTS=$DB_OPTS" -r -c uuid";;
        U)      DB_OPTS=$DB_OPTS" -c 'uuid "$OPTARG"'";;
        V)      xfs_db -p xfs_admin -V
@@ -37,8 +39,7 @@ case $# in
                # Pick up the log device, if present
                if [ -n "$2" ]; then
                        DB_OPTS=$DB_OPTS" -l '$2'"
-                       test -n "$REPAIR_OPTS" && \
-                               REPAIR_OPTS=$REPAIR_OPTS" -l '$2'"
+                       REPAIR_DEV_OPTS=$REPAIR_DEV_OPTS" -l '$2'"
                fi
 
                if [ -n "$DB_OPTS" ]
@@ -53,7 +54,7 @@ case $# in
                        # running xfs_admin.
                        # Ideally, we need to improve the output behaviour
                        # of repair for this purpose (say a "quiet" mode).
-                       eval xfs_repair $REPAIR_OPTS "$1" 2> /dev/null
+                       eval xfs_repair $REPAIR_DEV_OPTS $REPAIR_OPTS "$1" 2> /dev/null
                        status=`expr $? + $status`
                        if [ $status -ne 0 ]
                        then
index 8afc873fb50afac730f152e5f9cffa8a4a23484c..cccbb2248b2e64682ecf227aa80a25089af40795 100644 (file)
@@ -13,6 +13,9 @@ xfs_admin \- change parameters of an XFS filesystem
 ] [
 .B \-U
 .I uuid
+] [
+.B \-r
+.I rtdev
 ]
 .I device
 [
@@ -123,6 +126,11 @@ not be able to mount the filesystem.  To remove this incompatible flag, use
 which will restore the original UUID and remove the incompatible
 feature flag as needed.
 .TP
+.BI \-r " rtdev"
+Specifies the device special file where the filesystem's realtime section
+resides.
+Only for those filesystems which use a realtime section.
+.TP
 .B \-V
 Prints the version number and exits.
 .PP