This is the mail archive of the
cluster-cvs@sourceware.org
mailing list for the cluster.
STABLE2 - GFS2: sync buffers to disk when rewriting superblock
- From: Bob Peterson <rpeterso at fedoraproject dot org>
- To: cluster-cvs-relay at redhat dot com
- Date: Tue, 9 Sep 2008 22:09:55 +0000 (UTC)
- Subject: STABLE2 - GFS2: sync buffers to disk when rewriting superblock
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 */