diff options
author | Jan Kara <jack@suse.cz> | 2012-04-07 06:50:13 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2012-05-15 17:34:36 -0400 |
commit | 1ce8486dcc00c1e095af8d155fa4451936b89013 (patch) | |
tree | 416fc385dc25993f0a968d1a78fb07dd0b79be34 /fs/jbd/commit.c | |
parent | 9754e39c7bc51328f145e933bfb0df47cd67b6e9 (diff) |
jbd: protect all log tail updates with j_checkpoint_mutex
There are some log tail updates that are not protected by j_checkpoint_mutex.
Some of these are harmless because they happen during startup or shutdown but
updates in journal_commit_transaction() and journal_flush() can really race
with other log tail updates (e.g. someone doing journal_flush() with someone
running cleanup_journal_tail()). So protect all log tail updates with
j_checkpoint_mutex.
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/jbd/commit.c')
-rw-r--r-- | fs/jbd/commit.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c index dba9cfd75f1a..1b27f46e6108 100644 --- a/fs/jbd/commit.c +++ b/fs/jbd/commit.c | |||
@@ -308,7 +308,9 @@ void journal_commit_transaction(journal_t *journal) | |||
308 | /* Do we need to erase the effects of a prior journal_flush? */ | 308 | /* Do we need to erase the effects of a prior journal_flush? */ |
309 | if (journal->j_flags & JFS_FLUSHED) { | 309 | if (journal->j_flags & JFS_FLUSHED) { |
310 | jbd_debug(3, "super block updated\n"); | 310 | jbd_debug(3, "super block updated\n"); |
311 | mutex_lock(&journal->j_checkpoint_mutex); | ||
311 | journal_update_sb_log_tail(journal); | 312 | journal_update_sb_log_tail(journal); |
313 | mutex_unlock(&journal->j_checkpoint_mutex); | ||
312 | } else { | 314 | } else { |
313 | jbd_debug(3, "superblock not updated\n"); | 315 | jbd_debug(3, "superblock not updated\n"); |
314 | } | 316 | } |