Thread (8 messages) 8 messages, 6 authors, 2007-07-11

Re: [EXT4 set 4][PATCH 1/5] i_version:64 bit inode version

From: Andrew Morton <akpm@linux-foundation.org>
Date: 2007-07-11 06:35:29
Also in: linux-fsdevel, lkml

Possibly related (same subject, not in this thread)

On Tue, 10 Jul 2007 23:18:50 -0400 Mingming Cao [off-list ref] wrote:
On Tue, 2007-07-10 at 22:17 -0700, Andrew Morton wrote:
quoted
On Tue, 10 Jul 2007 22:09:08 -0400 Mingming Cao [off-list ref] wrote:
quoted
David Chinneer pointed that we need to journal the version number
updates together with the operations that causes the change of the inode
version number, in order to survive server crashes so clients won't see
the counter go backwards.

So increment i_version in fs code is probably the place to ensure the
inode version changes are stored to disk. It's seems update the ext4
inode version in every ext4_mark_inode_dirty() is the easiest way.
That still makes us dependent upon _something_ changing the inode.  For
overwrites the only something is mtime.

If we don't want to have a peculiar dependency upon s_time_gran=1e9 (and
I don't think we do) then I guess we'll need new code in or around
file_update_time() to do this.
do you mean mark inode dirty all the times in file_update_time()? Not
sure about the overhead for ext3/4.
hm, I hadn't thought about it in any detail.

Maybe something like
--- a/fs/inode.c~a
+++ a/fs/inode.c
@@ -1238,6 +1238,11 @@ void file_update_time(struct file *file)
 		sync_it = 1;
 	}
 
+	if (IS_I_VERSION_64(inode)) {
+		inode_inc_iversion(inode);	/* Takes i_lock on 32-bit */
+		sync_it = 1;
+	}
+
 	if (sync_it)
 		mark_inode_dirty_sync(inode);
 }
_

?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help