Skip to contentSkip to conversation

2.4.2 fs/inode.c

PATCH Jan Harkes 3 participants 5 messages Mar 22, 2001 – Mar 26, 2001 VFS

lore
Share & tools
lore

Jan Harkes

author
#0 lore raw

I found some code that seems wrong and didn't even match it's comment. Patch is against 2.4.2, but should go cleanly against 2.4.3-pre6 as well.

Jan

fs/inode.c renamed from fs/inode.c.orig +1 -1
@@ -133,7 +133,7 @@
 
 	if (sb) {
 		/* Don't do this for I_DIRTY_PAGES - that doesn't actually dirty the inode itself */
-		if (flags & (I_DIRTY | I_DIRTY_SYNC)) {
+		if (flags & (I_DIRTY_SYNC | I_DIRTY_DATASYNC)) {
 			if (sb->s_op && sb->s_op->dirty_inode)
 				sb->s_op->dirty_inode(inode);
 		}
#1 lore raw

Hi,

Quoted 3 lines · Jan Harkes

I found some code that seems wrong and didn't even match it's comment. Patch is against 2.4.2, but should go cleanly against 2.4.3-pre6 as well.

Patch looks fine to me. Have you tested it? If this goes wrong, things break badly...

fs/inode.c line 136

Quoted 3 lines
fs/inode.c renamed from fs/inode.c.orig +1 -1
 		/* Don't do this for I_DIRTY_PAGES - that doesn't actually dirty the inode itself */
-		if (flags & (I_DIRTY | I_DIRTY_SYNC)) {
+		if (flags & (I_DIRTY_SYNC | I_DIRTY_DATASYNC)) {

--Stephen

#2 lore raw
Quoted 9 lines · On Thursday, March 22, 2001 07:04:52 PM +0000 "Stephen C. Tweedie"…

Hi,

Quoted 3 lines · Jan Harkes

I found some code that seems wrong and didn't even match it's comment. Patch is against 2.4.2, but should go cleanly against 2.4.3-pre6 as well.

Patch looks fine to me. Have you tested it? If this goes wrong, things break badly...

This should only affect reiserfs, and it should be a good thing. I'll do some tests, thanks for spotting.

Quoted 4 lines

Review

Quoted 4 lines
(quoted diff) +1 -0
 		/* Don't do this for I_DIRTY_PAGES - that doesn't actually dirty the
 		inode itself */ -		if (flags & (I_DIRTY | I_DIRTY_SYNC)) {
+		if (flags & (I_DIRTY_SYNC | I_DIRTY_DATASYNC)) {

-chris

author
#3 lore raw
In reply to Jan Harkes
Quoted 9 lines · Stephen C. Tweedie

Hi,

Quoted 3 lines · Jan Harkes

I found some code that seems wrong and didn't even match it's comment. Patch is against 2.4.2, but should go cleanly against 2.4.3-pre6 as well.

Patch looks fine to me. Have you tested it? If this goes wrong, things break badly...

I've been running it for about a night and a morning now, nothing bad has happened, my ext2 filesystem shows up clean when forcing a fsck.

If things actually break badly, it is a very serious bug in the underlying FS. The FS should not 'happen to work' just because the VFS inadvertedly marked unmodified inodes as being dirty.

Jan

#4 lore raw
In reply to Jan Harkes
Quoted 4 lines · On Thursday, March 22, 2001 01:42:15 PM -0500 Jan Harkes <[email protected]>…

I found some code that seems wrong and didn't even match it's comment. Patch is against 2.4.2, but should go cleanly against 2.4.3-pre6 as well.

Ok, this looks correct, makes reiserfs faster, and survived under load. The idea was to only call dirty_inode if sync_one might decide the inode needs flushing to disk. So, the check in __mark_inode_dirty should look the same as the check in sync_one.

Quoted 12 lines
fs/inode.c renamed from fs/inode.c.orig +1 -1
@@ -133,7 +133,7 @@
 
 	 if (sb) {
 		 /* Don't do this for I_DIRTY_PAGES - that doesn't actually dirty the
 		 inode itself */ 
-		if (flags & (I_DIRTY | I_DIRTY_SYNC)) {
+		if (flags & (I_DIRTY_SYNC | I_DIRTY_DATASYNC)) {
 			 if (sb->s_op && sb->s_op->dirty_inode)
 				 sb->s_op->dirty_inode(inode);
		 }
Quoted 1 line

-

-chris