Skip to content

Commit

Permalink
ext2: also update the inode on disk when dir is IS_DIRSYNC
Browse files Browse the repository at this point in the history
We used to just write changed page for IS_DIRSYNC inodes.  But we also
have to update the directory inode itself just for the case that we've
allocated a new block and changed i_size.

[akpm@linux-foundation.org: still sync the data page]
Signed-off-by: Jan Kara <jack@suse.cz>
Tested-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Jan Kara authored and Linus Torvalds committed Jan 16, 2009
1 parent 634a84f commit 6b7021e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fs/ext2/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,13 @@ static int ext2_commit_chunk(struct page *page, loff_t pos, unsigned len)
mark_inode_dirty(dir);
}

if (IS_DIRSYNC(dir))
if (IS_DIRSYNC(dir)) {
err = write_one_page(page, 1);
else
if (!err)
err = ext2_sync_inode(dir);
} else {
unlock_page(page);
}

return err;
}
Expand Down

0 comments on commit 6b7021e

Please sign in to comment.