Skip to contentSkip to conversation

Test12 ll_rw_block error.

DISCUSSION Jeff Chua 3 participants 5 messages Dec 16, 2000 VFS

lore
Share & tools
lore

Jeff Chua

author
#0 lore raw
Quoted 5 lines

Now, I also agree that we should be able to clean this up properly for 2.5.x, and actually do exactly this for the anonymous buffers, so that the VM no longer needs to worry about buffer knowledge, and fs/buffer.c becomes just another user of the writepage functionality. That is not all that hard to do, it mainly just requires some small changes to how

Why not incorporate this change into 2.4.x?

Jeff
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#1 lore raw
Quoted 8 lines · Jeff Chua
Quoted 6 lines

Now, I also agree that we should be able to clean this up properly for 2.5.x, and actually do exactly this for the anonymous buffers, so that the VM no longer needs to worry about buffer knowledge, and fs/buffer.c becomes just another user of the writepage functionality. That is not all that hard to do, it mainly just requires some small changes to how

Why not incorporate this change into 2.4.x?

It might be 10 lines of change, and obviously correct.

And it might not be. If somebody wants to try out the DirtyPage approach for buffer handling, please do so. I'll apply it if it _does_ turn out to be as small as I suspect it might be, and if the code is straightforward and obvious.

If not, we're better off leaving it for 2.5.x

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#2 lore raw

On Fri, 15 Dec 2000, Linus Torvalds wrote:

[ writepage for anon buffers ]

Quoted 3 lines

It might be 10 lines of change, and obviously correct.

I'll give this a try, it will be interesting regardless of if it is simple enough for kernel inclusion.

On a related note, I hit a snag porting reiserfs into test12, where block_read_full_page assumes the buffer it gets back from get_block won't be up to date. When reiserfs reads a packed tail directly into the page, reading the newly mapped buffer isn't required, and is actually a bad idea, since the packed tails have a block number of 0 when copied into the page cache.

In other words, after calling reiserfs_get_block, the buffer might be mapped and uptodate, with no i/o required in block_read_full_page

The following patch to block_read_full_page fixes things for me, and seems like a good idea in general. It might be better to apply something similar to submit_bh instead...comments?

-chris

fs/buffer.c +4 -2
@@ -1706,8 +1706,10 @@
 			}
 		}
 
-		arr[nr] = bh;
-		nr++;
+		if (!buffer_uptodate(bh)) {
+			arr[nr] = bh;
+			nr++;
+	        }
 	} while (i++, iblock++, (bh = bh->b_this_page) != head);
 
 	if (!nr) {

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#3 lore raw
Quoted 7 lines · Chris Mason

In other words, after calling reiserfs_get_block, the buffer might be mapped and uptodate, with no i/o required in block_read_full_page

The following patch to block_read_full_page fixes things for me, and seems like a good idea in general. It might be better to apply something similar to submit_bh instead...comments?

Making the change to submit_bh() would make it look more like the old ll_rw_block() in this regard, but at the same time I really don't like the old ll_rw_block() interface that knew about semantics..

Your patch looks fine, although I'd personally prefer this one even more:

	fs/buffer.c patch cut-and-paste:
	+++ fs/buffer.c Sat Dec 16 11:02:44 2000
	@@ -1700,6 +1693,9 @@
	                                set_bit(BH_Uptodate, &bh->b_state);
	                                continue;
	                        }
	+                       /* get_block() might have updated the buffer synchronously */
	+                       if (buffer_uptodate(bh))
	+                               continue;
	                }
	 
	                arr[nr] = bh;

which makes it explicit about how we could have suddenly gotten an up-to-date buffer. Does that work for you?

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#4 lore raw
Quoted 2 lines · Linus Torvalds

Your patch looks fine, although I'd personally prefer this one even more:

Yes, that looks better and works here.

-chris

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/