diff options
author | Bob Peterson <rpeterso@redhat.com> | 2007-08-08 18:08:14 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2007-10-10 03:55:12 -0400 |
commit | 75be73a8246ef96f7fa3f05a6a1450159fbb7a64 (patch) | |
tree | d525c4c3c4e5f777ff9b96f50cc606433fcad8b6 | |
parent | 5f3eae7546093d845ca8ada1b95714202a136a1a (diff) |
[GFS2] Ensure journal file cache is flushed after recovery
This is for bugzilla bug #248176: GFS2: invalid metadata block
Patches 1 thru 3 were accepted upstream, but there were problems
with 4 and 5. Those issues have been resolved and now the recovery
tests are passing without errors. This code has gone through
41 * 3 successful gfs2 recovery tests before it hit an
unrelated (openais) problem. I'm continuing to test it.
This is a complete rewrite of patch 5 for bug #248176, written by
Steve Whitehouse. This is referred to in the bugzilla record as
"new 6" and "a different solution".
The problem was that the journal inodes, although protected by
a glock, were not synched with the other nodes because they don't
use the inode glock synch operations (i.e. no "glops" were defined).
Therefore, journal recovery on a journal-recovering node were causing
the blocks to get out of sync with the node that was actually trying
to use that journal as it comes back up from a reboot.
There are two possible solutions: (1) To make the journals use the
normal inode glock sync operations, or (2) To make the journal
operations take effect immediately (i.e. no caching). Although
option 1 works, it turns out to be a lot more code. Steve opted
for option 2, which is much simpler and therefore less prone to
regression errors.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
--
-rw-r--r-- | fs/gfs2/ops_fstype.c | 2 | ||||
-rw-r--r-- | fs/gfs2/recovery.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 58c730be2073..f0bcaa25737c 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c | |||
@@ -358,7 +358,7 @@ static int init_journal(struct gfs2_sbd *sdp, int undo) | |||
358 | 358 | ||
359 | ip = GFS2_I(sdp->sd_jdesc->jd_inode); | 359 | ip = GFS2_I(sdp->sd_jdesc->jd_inode); |
360 | error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, | 360 | error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, |
361 | LM_FLAG_NOEXP | GL_EXACT, | 361 | LM_FLAG_NOEXP | GL_EXACT | GL_NOCACHE, |
362 | &sdp->sd_jinode_gh); | 362 | &sdp->sd_jinode_gh); |
363 | if (error) { | 363 | if (error) { |
364 | fs_err(sdp, "can't acquire journal inode glock: %d\n", | 364 | fs_err(sdp, "can't acquire journal inode glock: %d\n", |
diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c index 5ada38c99a2c..beb6c7ac0086 100644 --- a/fs/gfs2/recovery.c +++ b/fs/gfs2/recovery.c | |||
@@ -469,7 +469,7 @@ int gfs2_recover_journal(struct gfs2_jdesc *jd) | |||
469 | }; | 469 | }; |
470 | 470 | ||
471 | error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, | 471 | error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, |
472 | LM_FLAG_NOEXP, &ji_gh); | 472 | LM_FLAG_NOEXP | GL_NOCACHE, &ji_gh); |
473 | if (error) | 473 | if (error) |
474 | goto fail_gunlock_j; | 474 | goto fail_gunlock_j; |
475 | } else { | 475 | } else { |