Skip to contentSkip to conversation

unneeded readpage in block_symlink

PATCH New Andrew Morton 1 participant 1 message May 2, 2002 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 unneeded readpage in block_symlink

The new consistency checks in buffer.c are complaining about block_symlink's ->readpage against an already uptodate page.

fs/buffer.c renamed from fs/buffer.c~block_symlink_fix +6 -2
@@ -2155,8 +2155,12 @@ int block_symlink(struct inode *inode, c
 	 * ->i_size will be enough for everything) and zero it out.
 	 * OTOH it's obviously correct and should make the page up-to-date.
 	 */
-	err = mapping->a_ops->readpage(NULL, page);
-	wait_on_page_locked(page);
+	if (!PageUptodate(page)) {
+		err = mapping->a_ops->readpage(NULL, page);
+		wait_on_page_locked(page);
+	} else {
+		unlock_page(page);
+	}
 	page_cache_release(page);
 	if (err < 0)
 		goto fail;

I've also received a report of a dirty unmapped buffer outside
i_size with ext3. But that was against the rd.c driver, which
seems to be bust in 2.5. This will take some hunting down.

-