Blame 0074-fs-lib-fs-lib.sh-removed-test-mounting-of-btrfs-and-.patch

Harald Hoyer 53e990
From 8f01a6a775fe9599fa8171d9cca17fb1b3c990af Mon Sep 17 00:00:00 2001
Harald Hoyer 53e990
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 53e990
Date: Fri, 22 Jun 2012 15:16:55 +0200
Harald Hoyer 53e990
Subject: [PATCH] fs-lib/fs-lib.sh: removed test mounting of btrfs and xfs
Harald Hoyer 53e990
Harald Hoyer 53e990
mount/umount check only costs time and we fail later anyway.
Harald Hoyer 53e990
mount can take very long on large filesystems. Better fail on the real
Harald Hoyer 53e990
mount.
Harald Hoyer 53e990
---
Harald Hoyer 53e990
 modules.d/99fs-lib/fs-lib.sh |   58 +++---------------------------------------
Harald Hoyer 53e990
 1 file changed, 4 insertions(+), 54 deletions(-)
Harald Hoyer 53e990
Harald Hoyer 53e990
diff --git a/modules.d/99fs-lib/fs-lib.sh b/modules.d/99fs-lib/fs-lib.sh
Harald Hoyer 53e990
index 75bee92..d1b7a9d 100755
Harald Hoyer 53e990
--- a/modules.d/99fs-lib/fs-lib.sh
Harald Hoyer 53e990
+++ b/modules.d/99fs-lib/fs-lib.sh
Harald Hoyer 53e990
@@ -80,63 +80,13 @@ fsck_able() {
Harald Hoyer 53e990
 # note: all drivers inherit: _drv _fop _dev
Harald Hoyer 53e990
 
Harald Hoyer 53e990
 fsck_drv_xfs() {
Harald Hoyer 53e990
-    local _ret
Harald Hoyer 53e990
-
Harald Hoyer 53e990
-    # fs must be cleanly mounted (and umounted) first, before attempting any
Harald Hoyer 53e990
-    # xfs tools - if this works, nothing else should be needed
Harald Hoyer 53e990
-    # note, that user is always dropped into the shell, if the filesystem is
Harald Hoyer 53e990
-    # not mountable or if -f flag is found among _fop
Harald Hoyer 53e990
-    mkdir -p /tmp/.xfs
Harald Hoyer 53e990
-
Harald Hoyer 53e990
-    info "trying to mount $_dev"
Harald Hoyer 53e990
-    if mount -t xfs ${_fsopts+-o $_fsopts} "$_dev" "/tmp/.xfs" >/dev/null 2>&1; then
Harald Hoyer 53e990
-        _ret=0
Harald Hoyer 53e990
-        info "xfs: $_dev is clean"
Harald Hoyer 53e990
-        umount "$_dev" >/dev/null 2>&1
Harald Hoyer 53e990
-    else
Harald Hoyer 53e990
-        _ret=4
Harald Hoyer 53e990
-        warn "*** $_dev is unmountable"
Harald Hoyer 53e990
-    fi
Harald Hoyer 53e990
-    if [ $_ret -gt 0 ] || strstr "$_fop" "-f"; then
Harald Hoyer 53e990
-        warn "*** Dropping you to a shell. You have"
Harald Hoyer 53e990
-        warn "*** xfs_repair and xfs_check (xfs_db) available."
Harald Hoyer 53e990
-        warn "*** Note that if xfs didn't mount properly, it's"
Harald Hoyer 53e990
-        warn "*** probably pretty serious condition."
Harald Hoyer 53e990
-        emergency_shell -n "(Repair filesystem)"
Harald Hoyer 53e990
-    fi
Harald Hoyer 53e990
-
Harald Hoyer 53e990
-    rm -r /tmp/.xfs
Harald Hoyer 53e990
-    return $_ret
Harald Hoyer 53e990
+    # xfs fsck is not necessary... Either it mounts or not
Harald Hoyer 53e990
+    return 0
Harald Hoyer 53e990
 }
Harald Hoyer 53e990
 
Harald Hoyer 53e990
 fsck_drv_btrfs() {
Harald Hoyer 53e990
-    local _ret
Harald Hoyer 53e990
-
Harald Hoyer 53e990
-    # fs must be cleanly mounted (and umounted) first, before attempting any
Harald Hoyer 53e990
-    # btrfs tools - if this works, nothing else should be needed
Harald Hoyer 53e990
-    # note, that user is always dropped into the shell, if the filesystem is
Harald Hoyer 53e990
-    # not mountable or if -f flag is found among _fop
Harald Hoyer 53e990
-    mkdir -p /tmp/.btrfs
Harald Hoyer 53e990
-
Harald Hoyer 53e990
-    info "trying to mount $_dev"
Harald Hoyer 53e990
-    if mount -t btrfs ${_fsopts+-o $_fsopts} "$_dev" "/tmp/.btrfs" >/dev/null 2>&1; then
Harald Hoyer 53e990
-        _ret=0
Harald Hoyer 53e990
-        info "btrfs: $_dev is clean"
Harald Hoyer 53e990
-        umount "$_dev" >/dev/null 2>&1
Harald Hoyer 53e990
-    else
Harald Hoyer 53e990
-        _ret=4
Harald Hoyer 53e990
-        warn "*** $_dev is unmountable"
Harald Hoyer 53e990
-    fi
Harald Hoyer 53e990
-    if [ $_ret -gt 0 ] || strstr "$_fop" "-f"; then
Harald Hoyer 53e990
-        warn "*** Dropping you to a shell. You have"
Harald Hoyer 53e990
-        warn "*** btrfsck available."
Harald Hoyer 53e990
-        warn "*** Note that if btrfs didn't mount properly, it's"
Harald Hoyer 53e990
-        warn "*** probably pretty serious condition."
Harald Hoyer 53e990
-        emergency_shell -n "(Repair filesystem)"
Harald Hoyer 53e990
-    fi
Harald Hoyer 53e990
-
Harald Hoyer 53e990
-    rm -r /tmp/.btrfs
Harald Hoyer 53e990
-    return $_ret
Harald Hoyer 53e990
+    # btrfs fsck is not necessary... Either it mounts or not
Harald Hoyer 53e990
+    return 0
Harald Hoyer 53e990
 }
Harald Hoyer 53e990
 
Harald Hoyer 53e990