[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH rhel5-branch] Use tune4fs for ext4 filesystems (#616184)



NOTE: This looked fairly simple. I'll attach it to the bz if acked.

Need to use tune4fs on ext4 filesystems instead of tune2fs. This is
only needed for RHEL5.

Resolves: rhbz#616184
---
 fsset.py |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/fsset.py b/fsset.py
index 54753a0..5737283 100644
--- a/fsset.py
+++ b/fsset.py
@@ -755,7 +755,7 @@ class ext4FileSystem(extFileSystem):
         if rc:
             raise SystemError
         entry.setLabel(label)
-        
+
     def formatDevice(self, entry, progress, chroot='/'):
         devicePath = entry.device.setupDevice(chroot)
         devArgs = self.getDeviceArgs(entry.device)
@@ -764,7 +764,7 @@ class ext4FileSystem(extFileSystem):
         args.extend(devArgs)
         args.extend(self.extraFormatArgs)
 
-	log.info("Format command:  %s\n" % str(args))
+        log.info("Format command:  %s\n" % str(args))
 
         rc = ext2FormatFilesystem(args, "/dev/tty5",
                                   progress,
@@ -772,8 +772,21 @@ class ext4FileSystem(extFileSystem):
         if rc:
             raise SystemError
 
-        extFileSystem.setExt3Options(self, entry, progress, chroot)
- 
+        self.setExt3Options(self, entry, progress, chroot)
+
+    def setExt3Options(self, entry, message, chroot='/'):
+        devicePath = entry.device.setupDevice(chroot)
+
+        # if no journal, don't turn off the fsck
+        if not isys.ext2HasJournal(devicePath, makeDevNode = 0):
+            return
+
+        rc = iutil.execWithRedirect("/usr/sbin/tune4fs",
+                                    ["-c0", "-i0", "-Odir_index",
+                                     "-ouser_xattr,acl", devicePath],
+                                    stdout = "/dev/tty5",
+                                    stderr = "/dev/tty5")
+
 fileSystemTypeRegister(ext4FileSystem())
 
 class raidMemberDummyFileSystem(FileSystemType):
-- 
1.7.1.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]