Skip to content

Commit

Permalink
ext4: Make sure ext4_dirty_inode() updates the inode in no journal mode
Browse files Browse the repository at this point in the history
This patch a problem that ext4_dirty_inode() was not calling
ext4_mark_inode_dirty() if the current_handle is not valid, which it
is the case in no journal mode.

It also removes a test for non-matching transaction which can never
happen.

Signed-off-by: Curt Wohlgemuth <curtw@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
  • Loading branch information
Curt Wohlgemuth authored and Theodore Ts'o committed Sep 29, 2009
1 parent 830156c commit f3dc272
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -5615,24 +5615,13 @@ void ext4_dirty_inode(struct inode *inode)
handle_t *current_handle = ext4_journal_current_handle();
handle_t *handle;

if (!ext4_handle_valid(current_handle)) {
ext4_mark_inode_dirty(current_handle, inode);
return;
}

handle = ext4_journal_start(inode, 2);
if (IS_ERR(handle))
goto out;
if (current_handle &&
current_handle->h_transaction != handle->h_transaction) {
/* This task has a transaction open against a different fs */
printk(KERN_EMERG "%s: transactions do not match!\n",
__func__);
} else {
jbd_debug(5, "marking dirty. outer handle=%p\n",
current_handle);
ext4_mark_inode_dirty(handle, inode);
}

jbd_debug(5, "marking dirty. outer handle=%p\n", current_handle);
ext4_mark_inode_dirty(handle, inode);

ext4_journal_stop(handle);
out:
return;
Expand Down

0 comments on commit f3dc272

Please sign in to comment.