2010-03-26 22:01:30

by Curt Wohlgemuth

[permalink] [raw]
Subject: [PATCH] ext4: use __ext4_get_inode_loc() from ext4_write_inode()

Fix for no-journal ext4_write_inode() code path: ensure in_mem is 0 on call
to __ext4_get_inode_loc()

Signed-off-by: Curt Wohlgemuth <[email protected]>
---

In the no-journal case, ext4_write_inode() simply gets the BH for the inode
table block and calls sync_dirty_buffer() on it. But it doesn't copy the
in-memory inode contents to the on-disk format on the BH. So it *must* not
cause the in_mem parameter to __ext4_get_inode_loc() to be 1, which it will
be if it uses ext4_get_inode_loc().


diff -uprN orig/fs/ext4/inode.c new/fs/ext4/inode.c
--- orig/fs/ext4/inode.c 2010-03-22 08:16:57.000000000 -0700
+++ new/fs/ext4/inode.c 2010-03-26 14:50:38.000000000 -0700
@@ -5374,7 +5374,7 @@ int ext4_write_inode(struct inode *inode
} else {
struct ext4_iloc iloc;

- err = ext4_get_inode_loc(inode, &iloc);
+ err = __ext4_get_inode_loc(inode, &iloc, 0);
if (err)
return err;
if (wbc->sync_mode == WB_SYNC_ALL)


2010-04-03 21:28:53

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH] ext4: use __ext4_get_inode_loc() from ext4_write_inode()

On Fri, Mar 26, 2010 at 03:01:26PM -0700, Curt Wohlgemuth wrote:
> Fix for no-journal ext4_write_inode() code path: ensure in_mem is 0 on call
> to __ext4_get_inode_loc()
>
> Signed-off-by: Curt Wohlgemuth <[email protected]>

Applied to the ext4 patch queue.

- Ted