[Ocfs2-tools-devel] [PATCH 3/6] o2cb: don't write sysconfig if status not changed

Junxiao Bi junxiao.bi at oracle.com
Mon Jun 29 01:29:28 PDT 2015


Signed-off-by: Junxiao Bi <junxiao.bi at oracle.com>
---
 vendor/common/o2cb.init.sh |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/vendor/common/o2cb.init.sh b/vendor/common/o2cb.init.sh
index 9e0b31c..e2f80f7 100755
--- a/vendor/common/o2cb.init.sh
+++ b/vendor/common/o2cb.init.sh
@@ -1925,16 +1925,20 @@ case "$1" in
         ;;
 
     enable)
-        O2CB_ENABLED=true
-        write_sysconfig
-        if_fail "$?" "Unable to write the driver configuration"
+        if [ "$O2CB_ENABLED" != "true" ]; then
+            O2CB_ENABLED=true
+            write_sysconfig
+            if_fail "$?" "Unable to write the driver configuration"
+        fi
         start
         ;;
 
     disable)
-        O2CB_ENABLED=false
-        write_sysconfig
-        if_fail "$?" "Unable to write the driver configuration"
+        if [ "$O2CB_ENABLED" != "false" ]; then
+            O2CB_ENABLED=false
+            write_sysconfig
+            if_fail "$?" "Unable to write the driver configuration"
+        fi
         stop
         ;;
 
-- 
1.7.9.5




More information about the Ocfs2-tools-devel mailing list