]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ext2 synchronous mount fix
authorAndrew Morton <akpm@digeo.com>
Sat, 14 Dec 2002 11:19:27 +0000 (03:19 -0800)
committerJaroslav Kysela <perex@suse.cz>
Sat, 14 Dec 2002 11:19:27 +0000 (03:19 -0800)
The optimisation for synchronous mounts was only correct for S_ISREG
files.  Directories do not pass through generic_osync_inode() and we
still need to synchronously write out their indirect blocks.

fs/ext2/inode.c

index f04ec5f0b98eda366aef8dae27a7cfc612de3f05..7b876c242aba314c2da269e4e672e4702ec6bc7e 100644 (file)
@@ -430,8 +430,12 @@ static int ext2_alloc_branch(struct inode *inode,
                mark_buffer_dirty_inode(bh, inode);
                /* We used to sync bh here if IS_SYNC(inode).
                 * But we now rely upon generic_osync_inode()
-                * and b_inode_buffers
+                * and b_inode_buffers.  But not for directories.
                 */
+               if (S_ISDIR(inode->i_mode) && IS_DIRSYNC(inode)) {
+                       ll_rw_block(WRITE, 1, &bh);
+                       wait_on_buffer(bh);
+               }
                parent = nr;
        }
        if (n == num)