File xfsprogs-xfs_admin-support-external-log-devices.patch of Package xfsprogs.21555
From 8db10a9a14a8f9308d7b89b776b6a4029405d612 Mon Sep 17 00:00:00 2001
From: "Darrick J. Wong" <darrick.wong@oracle.com>
Date: Fri, 13 Dec 2019 16:21:18 -0500
Subject: [PATCH] xfs_admin: support external log devices
Git-commit: 8db10a9a14a8f9308d7b89b776b6a4029405d612
Patch-mainline: v5.4.0-rc1
References: bsc#1189984
Add to xfs_admin the ability to pass external log devices to xfs_db.
This is necessary to make changes on such filesystems.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Acked-by: Anthony Iliopoulos <ailiop@suse.com>
---
db/xfs_admin.sh | 12 ++++++++++--
man/man8/xfs_admin.8 | 14 ++++++++++++++
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/db/xfs_admin.sh b/db/xfs_admin.sh
index 305ef2b7da63..bd325da2f776 100755
--- a/db/xfs_admin.sh
+++ b/db/xfs_admin.sh
@@ -7,7 +7,7 @@
status=0
DB_OPTS=""
REPAIR_OPTS=""
-USAGE="Usage: xfs_admin [-efjlpuV] [-c 0|1] [-L label] [-U uuid] device"
+USAGE="Usage: xfs_admin [-efjlpuV] [-c 0|1] [-L label] [-U uuid] device [logdev]"
while getopts "efjlpuc:L:U:V" c
do
@@ -33,7 +33,15 @@ done
set -- extra $@
shift $OPTIND
case $# in
- 1) if [ -n "$DB_OPTS" ]
+ 1|2)
+ # 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'"
+ fi
+
+ if [ -n "$DB_OPTS" ]
then
eval xfs_db -x -p xfs_admin $DB_OPTS $1
status=$?
diff --git a/man/man8/xfs_admin.8 b/man/man8/xfs_admin.8
index 20a114f5f550..8afc873fb50a 100644
--- a/man/man8/xfs_admin.8
+++ b/man/man8/xfs_admin.8
@@ -15,6 +15,9 @@ xfs_admin \- change parameters of an XFS filesystem
.I uuid
]
.I device
+[
+.I logdev
+]
.br
.B xfs_admin \-V
.SH DESCRIPTION
@@ -31,6 +34,17 @@ A number of parameters of a mounted filesystem can be examined
and modified using the
.BR xfs_growfs (8)
command.
+.PP
+The optional
+.B logdev
+parameter specifies the device special file where the filesystem's external
+log resides.
+This is required only for filesystems that use an external log.
+See the
+.B mkfs.xfs \-l
+option, and refer to
+.BR xfs (5)
+for a detailed description of the XFS log.
.SH OPTIONS
.TP
.B \-e
--
2.33.1