Commit 5315217e authored by Jan Kara's avatar Jan Kara Committed by Theodore Ts'o

[PATCH] jbd: Remove useless loop when writing commit record

Commit block was intended to have several copies of the header. But
due to a bug it never had them and actually, nobody checks that. So
just remove the useless loop.
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent b048d846
...@@ -104,7 +104,8 @@ static int journal_write_commit_record(journal_t *journal, ...@@ -104,7 +104,8 @@ static int journal_write_commit_record(journal_t *journal,
{ {
struct journal_head *descriptor; struct journal_head *descriptor;
struct buffer_head *bh; struct buffer_head *bh;
int i, ret; journal_header_t *header;
int ret;
int barrier_done = 0; int barrier_done = 0;
if (is_journal_aborted(journal)) if (is_journal_aborted(journal))
...@@ -116,13 +117,10 @@ static int journal_write_commit_record(journal_t *journal, ...@@ -116,13 +117,10 @@ static int journal_write_commit_record(journal_t *journal,
bh = jh2bh(descriptor); bh = jh2bh(descriptor);
/* AKPM: buglet - add `i' to tmp! */ header = (journal_header_t *)(bh->b_data);
for (i = 0; i < bh->b_size; i += 512) { header->h_magic = cpu_to_be32(JFS_MAGIC_NUMBER);
journal_header_t *tmp = (journal_header_t*)bh->b_data; header->h_blocktype = cpu_to_be32(JFS_COMMIT_BLOCK);
tmp->h_magic = cpu_to_be32(JFS_MAGIC_NUMBER); header->h_sequence = cpu_to_be32(commit_transaction->t_tid);
tmp->h_blocktype = cpu_to_be32(JFS_COMMIT_BLOCK);
tmp->h_sequence = cpu_to_be32(commit_transaction->t_tid);
}
JBUFFER_TRACE(descriptor, "write commit block"); JBUFFER_TRACE(descriptor, "write commit block");
set_buffer_dirty(bh); set_buffer_dirty(bh);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment