bug-grub
[Top][All Lists]
Advanced

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

Double sync, one more time


From: Pavel Roskin
Subject: Double sync, one more time
Date: Thu, 4 Apr 2002 11:01:24 -0500 (EST)

Hello!

I understand that GRUB 0.92 will be released soon.  I sent this patch
already and it was rejected because some better solution is planned.  The
problem is very serious under Linux 2.4.x on ext3 and reiferfs - it's very
easy to make the system unbootable if my patch is not applied.

grub-install copies new stage* files to /boot/grub, but grub only runs
sync() once, which is insufficient on Linux, at least on journaling
filesystems.  We can discuss whether Linux does the right thing or not,
but GRUB does a wrong thing by not taking the necessary precaucions.

I suggest this patch to be applied before the release.  Feel free to back 
it out once you have a better solution.

===========================================
--- ChangeLog
+++ ChangeLog
@@ -1 +1,6 @@
+2002-04-04  Pavel Roskin  <address@hidden>
+
+       * grub/main.c (main): Call sync() twice because one sync is not
+       enough for journaling filesystems under Linux.
+
 2002-04-04  Yoshinori K. Okuji  <address@hidden>
--- grub/main.c
+++ grub/main.c
@@ -135,6 +135,10 @@ main (int argc, char **argv)
      actually written to disks. This is very important because GRUB does
      not use ordinary stdio interface but raw devices.  */
   sync ();
+
+  /* Do it one more time because one sync() is not sufficient for some
+     Linux filesystems (ext3, reiserfs).  */
+  sync ();
   
   program_name = argv[0];
   default_boot_drive = boot_drive;
===========================================

-- 
Regards,
Pavel Roskin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]