ext2: also update the inode on disk when dir is IS_DIRSYNC

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, January 15, 2009 - 7:02 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6b7021...
Commit:     6b7021ef7e1a703c7092daeceda063951b22b4f6
Parent:     634a84f8d5b74da497688d3346f6809c28239eda
Author:     Jan Kara <jack@suse.cz>
AuthorDate: Thu Jan 15 13:51:29 2009 -0800
Committer:  Linus Torvalds <torvalds@linux-foundation.org>
CommitDate: Thu Jan 15 16:39:42 2009 -0800

    ext2: also update the inode on disk when dir is IS_DIRSYNC
    
    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>
---
 fs/ext2/dir.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c
index 9a0fc40..2999d72 100644
--- a/fs/ext2/dir.c
+++ b/fs/ext2/dir.c
@@ -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;
 }
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
ext2: also update the inode on disk when dir is IS_DIRSYNC, Linux Kernel Mailing ..., (Thu Jan 15, 7:02 pm)