public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* STABLE2 - GFS2: sync buffers to disk when rewriting superblock
@ 2008-09-09 22:18 Bob Peterson
  0 siblings, 0 replies; only message in thread
From: Bob Peterson @ 2008-09-09 22:18 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=a67ddce0f321b800b68362bb96b5cf20081b483a
Commit:        a67ddce0f321b800b68362bb96b5cf20081b483a
Parent:        a7f790217bb6914f91d698b481021fb22a923aea
Author:        Bob Peterson <rpeterso@redhat.com>
AuthorDate:    Tue Sep 9 16:57:22 2008 -0500
Committer:     Bob Peterson <rpeterso@redhat.com>
CommitterDate: Tue Sep 9 17:10:56 2008 -0500

GFS2: sync buffers to disk when rewriting superblock

bz 461290

GFS2: mount during fsck protections not working.
When gfs2_fsck is run, it is supposed to rewrite the locking
protocol in the superblock to "fsck_xxxx" (e.g. "fsck_dlm")
to prevent all cluster nodes from mounting the file system
while gfs2_fsck is running.  The data was being written out,
but the buffers were not synched to disk.  That created a
timing window where processes could still mount the file
system.  This was uncovered by the gfs2_fsck_stress test.
This fix syncs the buffers to disk before continuing.
Note that this still does not prevent users from running
gfs2_fsck on file systems that are still mounted, but that is
the way it has always been in the past.
---
 gfs2/libgfs2/buf.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/gfs2/libgfs2/buf.c b/gfs2/libgfs2/buf.c
index b706375..e3c437b 100644
--- a/gfs2/libgfs2/buf.c
+++ b/gfs2/libgfs2/buf.c
@@ -166,6 +166,7 @@ void bcommit(struct gfs2_sbd *sdp)
 			bh->b_changed = FALSE;    /* no longer changed */
 		}
 	}
+	fsync(sdp->device_fd);
 }
 
 /* Check for unreleased buffers */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-09-09 22:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-09 22:18 STABLE2 - GFS2: sync buffers to disk when rewriting superblock Bob Peterson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).