--- 2.4.19pre4aa1/fs/xfs/pagebuf/page_buf_io.c.~1~ Fri Mar 29 21:48:35 2002 +++ 2.4.19pre4aa1/fs/xfs/pagebuf/page_buf_io.c Fri Mar 29 22:36:40 2002 @@ -369,6 +369,7 @@ /* Do our own allocation to avoid the buffer_head overhead */ kp = kmalloc(sizeof(struct kiobuf), SLAB_KERNEL); if (!kp) { + nomem: pb->pb_flags &= ~_PBF_LOCKABLE; pagebuf_rele(pb); if (rdp) @@ -376,8 +377,11 @@ return 0; } memset(kp, 0, sizeof(struct kiobuf)); - kp->array_len = KIO_STATIC_PAGES; - kp->maplist = kp->map_array; + if (expand_kiobuf(kp, KIO_STATIC_PAGES)) { + kfree(kp); + goto nomem; + } + if (rdp) { iovecp = rdp->io_iovec[rdp->io_iovec_index]; user_addr = iovecp->iov_base + rdp->io_iovec_offset; @@ -391,6 +395,7 @@ rval = pagebuf_iostart(pb, pb_flags); unmap_kiobuf(kp); } + kfree(kp->maplist); kfree(kp); if (rdp) {