[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-pm-utils
Subject:    [Pm-utils] [PATCH] Prevent journal-commit from overriding /etc/fstab
From:       "Nic Case" <niccase () myway ! com>
Date:       2010-11-23 4:20:27
Message-ID: 20101122232027.17571 () web010 ! roc2 ! bluetie ! com
[Download RAW message or body]

If a user sets the commit parameter in /etc/fstab, the value would have been ignored \
and reset to the default kernel value of 5 s.  By not  passing the commit parameter \
explicitly, the value will be taken from the /etc/fstab file, or if not present in \
that file, will be reset to the default  kernel value of 5 s.

Signed off by Nic Case <niccase@myway.com>
---
diff --git a/pm/power.d/journal-commit b/pm/power.d/journal-commit
index 5c0fc16..325e6d5 100644
--- a/pm/power.d/journal-commit
+++ b/pm/power.d/journal-commit
@@ -24,7 +24,7 @@ remount_fs()
 {
        # $1 = filesystem to remount
        # $2 = mount option to change
-       mount -o remount,$2 $1
+       mount -o remount$2 $1
 }
 
 # invoked on an ext3 file system
@@ -32,7 +32,11 @@ handle_ext3()
 {
        # $1 = filesystem to remount
        # $2 = commit time
-       remount_fs $1 "commit=${2}"
+       if [ "$2" = "0" ]; then
+               remount_fs $1 
+       else
+               remount_fs $1 ",commit=${2}" 
+       fi
 }
 
 handle_ext4() { handle_ext3 "$@"; }
_______________________________________________
Pm-utils mailing list
Pm-utils@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pm-utils


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic