Whamcloud - gitweb
LU-12227 scripts: check for mounted ZFS devices too 66/34766/2
authorAurelien Degremont <degremoa@amazon.com>
Fri, 26 Apr 2019 09:58:37 +0000 (09:58 +0000)
committerOleg Drokin <green@whamcloud.com>
Wed, 8 May 2019 06:05:24 +0000 (06:05 +0000)
lustre init script skips several checks if the device type is ZFS. If
some ZFS devices are already mounted, the script will return a
non-zero exit code.

The label and mount point check is valid for ZFS devices, so let's do
it and avoid this error case. With this patch, when starting ZFS
devices the script will only start the not already started ones and if
it succeeds, return 0.

Test-Parameters: trivial
Signed-off-by: Aurelien Degremont <degremoa@amazon.com>
Change-Id: I152ca4d62d444193cc66896173873587f0761493
Reviewed-on: https://review.whamcloud.com/34766
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-by: Nathaniel Clark <nclark@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/scripts/lustre

index f258cb4..cf5403e 100644 (file)
@@ -455,13 +455,14 @@ start_services ()
                        assemble_md_device $journal $raidtab 2>/dev/null
                fi
 
+               if mountpt_is_active $label || \
+                  device_is_active $label; then
+                       echo "$label is already mounted"
+                       # no error
+                       continue
+               fi
+
                if [ "x$devtype" != "xzfs" ] ; then
-                       if mountpt_is_active $label || \
-                          device_is_active $label; then
-                               echo "$label is already mounted"
-                               # no error
-                               continue
-                       fi
                        if ! mmp_test $dev; then
                                result=2
                                continue