summaryrefslogtreecommitdiffstats
path: root/fs/ext4/ext4_jbd2.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2009-09-12 13:41:55 -0400
committerTheodore Ts'o <tytso@mit.edu>2009-09-12 13:41:55 -0400
commitfe188c0e084bdf3038dc0ac963c21d764f53f7da (patch)
treebb712f58f4c0356058825da75da57d0af450e01b /fs/ext4/ext4_jbd2.c
parentc7acb4c16646943180bd221c167a077e0a084f9c (diff)
downloadlinux-fe188c0e084bdf3038dc0ac963c21d764f53f7da.tar.bz2
ext4: Assure that metadata blocks are written during fsync in no journal mode
When there is no journal present, we must attach buffer heads associated with extent tree and indirect blocks to the inode's mapping->private_list via mark_buffer_dirty_inode() so that ext4_sync_file() --- which is called to service fsync() and fdatasync() system calls --- can write out the inode's metadata blocks by calling sync_mapping_buffers(). Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4_jbd2.c')
-rw-r--r--fs/ext4/ext4_jbd2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c
index ecb9ca455fd5..6a9409920dee 100644
--- a/fs/ext4/ext4_jbd2.c
+++ b/fs/ext4/ext4_jbd2.c
@@ -89,7 +89,10 @@ int __ext4_handle_dirty_metadata(const char *where, handle_t *handle,
ext4_journal_abort_handle(where, __func__, bh,
handle, err);
} else {
- mark_buffer_dirty(bh);
+ if (inode && bh)
+ mark_buffer_dirty_inode(bh, inode);
+ else
+ mark_buffer_dirty(bh);
if (inode && inode_needs_sync(inode)) {
sync_dirty_buffer(bh);
if (buffer_req(bh) && !buffer_uptodate(bh)) {