couple of minor bugs in kiobufs

V Ganesh (ganesh@veritas.com)
Tue, 28 Dec 1999 12:58:45 +0530 (IST)


hi,
here are a couple of patches:

1. in end_io_buffer_kiobuf() in fs/buffer.c, kiobuf->errno is set after
kiobuf->end_io() is called. I think it ought to be done earlier, otherwise
an error in the last buffer_head is not reflected in kiobuf->errno when
kiobuf->end_io() runs. this doesn't cause any problems currently since
do_kio() looks at BH_Uptodate of each of the buffer_heads.

2. get_page_map(), which is used only by kiobuf code AFAIK. MAP_NR() should
be called with vaddr.

ganesh

--- linux/fs/buffer.c.ORG Tue Dec 28 14:53:48 1999
+++ linux/fs/buffer.c Tue Dec 28 14:54:32 1999
@@ -1550,10 +1550,10 @@
mark_buffer_uptodate(bh, uptodate);

kiobuf = bh->b_kiobuf;
- if (atomic_dec_and_test(&kiobuf->io_count))
- kiobuf->end_io(kiobuf);
if (!uptodate)
kiobuf->errno = -EIO;
+ if (atomic_dec_and_test(&kiobuf->io_count))
+ kiobuf->end_io(kiobuf);
}
--- linux/mm/memory.c.ORG Tue Dec 28 14:54:42 1999
+++ linux/mm/memory.c Tue Dec 28 14:55:22 1999
@@ -418,7 +418,7 @@

struct page * get_page_map(struct page *page, unsigned long vaddr)
{
- if (MAP_NR(page) >= max_mapnr)
+ if (MAP_NR(vaddr) >= max_mapnr)
return 0;
if (page == ZERO_PAGE(vaddr))
return 0;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/