aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2011-03-16 17:16:31 -0400
committerTheodore Ts'o <tytso@mit.edu>2011-03-16 17:16:31 -0400
commit688f869ce3bdc892daa993534dc6df18c95df931 (patch)
treeaea78b966a70e3e0200a88bfaddb86e7fd3f1092 /fs/ext4
parent198868f35de99e7197829314076e5465c37e4cc5 (diff)
ext4: Initialize fsync transaction ids in ext4_new_inode()
When allocating a new inode, we need to make sure i_sync_tid and i_datasync_tid are initialized. Otherwise, one or both of these two values could be left initialized to zero, which could potentially result in BUG_ON in jbd2_journal_commit_transaction. (This could happen by having journal->commit_request getting set to zero, which could wake up the kjournald process even though there is no running transaction, which then causes a BUG_ON via the J_ASSERT(j_ruinning_transaction != NULL) statement. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/ialloc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 2fd3b0e41787..a679a482c986 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -1054,6 +1054,11 @@ got:
1054 } 1054 }
1055 } 1055 }
1056 1056
1057 if (ext4_handle_valid(handle)) {
1058 ei->i_sync_tid = handle->h_transaction->t_tid;
1059 ei->i_datasync_tid = handle->h_transaction->t_tid;
1060 }
1061
1057 err = ext4_mark_inode_dirty(handle, inode); 1062 err = ext4_mark_inode_dirty(handle, inode);
1058 if (err) { 1063 if (err) {
1059 ext4_std_error(sb, err); 1064 ext4_std_error(sb, err);