This is the mail archive of the
cluster-cvs@sourceware.org
mailing list for the cluster.
RHEL5 - 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:17:29 +0000 (UTC)
- Subject: RHEL5 - GFS2: sync buffers to disk when rewriting superblock
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=3a0a018e2cf6227c6b57d05bb7da0aa0a11cb445
Commit: 3a0a018e2cf6227c6b57d05bb7da0aa0a11cb445
Parent: 7f82d2325f5045b3cb2b0453b3547884f20f0e8d
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 16:57:22 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 7985945..637b9d1 100644
--- a/gfs2/libgfs2/buf.c
+++ b/gfs2/libgfs2/buf.c
@@ -179,6 +179,7 @@ void bcommit(struct gfs2_sbd *sdp)
bh->b_changed = FALSE; /* no longer changed */
}
}
+ fsync(sdp->device_fd);
}
/* Check for unreleased buffers */