diff options
| author | Alex Tomas <alex@clusterfs.com> | 2005-03-07 17:46:14 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-03-07 17:46:14 -0800 |
| commit | 5025daf1ae75ab4d91f48cebb9af3d4a519e611b (patch) | |
| tree | 8153e9d4613da8c981006029cf85d3868d4c84c8 /fs/jbd/commit.c | |
| parent | 0142e3ff96edcf707297cf81e54d917664951a28 (diff) | |
[PATCH] jbd: journal overflow fix #2
fix against credits leak in journal_release_buffer()
The idea is to charge a buffer in journal_dirty_metadata(), not in
journal_get_*_access()). Each buffer has flag call
journal_dirty_metadata() sets on the buffer.
Signed-off-by: Alex Tomas <alex@clusterfs.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/jbd/commit.c')
| -rw-r--r-- | fs/jbd/commit.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c index aa5f22435d0c..2069cbc9cb1b 100644 --- a/fs/jbd/commit.c +++ b/fs/jbd/commit.c @@ -229,6 +229,22 @@ void journal_commit_transaction(journal_t *journal) jbd_debug (3, "JBD: commit phase 2\n"); /* + * First, drop modified flag: all accesses to the buffers + * will be tracked for a new trasaction only -bzzz + */ + spin_lock(&journal->j_list_lock); + if (commit_transaction->t_buffers) { + new_jh = jh = commit_transaction->t_buffers->b_tnext; + do { + J_ASSERT_JH(new_jh, new_jh->b_modified == 1 || + new_jh->b_modified == 0); + new_jh->b_modified = 0; + new_jh = new_jh->b_tnext; + } while (new_jh != jh); + } + spin_unlock(&journal->j_list_lock); + + /* * Now start flushing things to disk, in the order they appear * on the transaction lists. Data blocks go first. */ |
