[PATCH] small bugfix for ll_rw_bio() for 2.5.3-pre3

Badari Pulavarty (pbadari@us.ibm.com)
Wed, 23 Jan 2002 16:44:24 -0800 (PST)


Hi,

Here is a small bug fix for ll_rw_bio() for 2.5.3-pre3.
kio->io_count can be safely incremented only after
bio_alloc() success.

Thanks,
Badari

--- linux-253pre3/fs/bio.c Thu Dec 27 08:15:15 2001
+++ linux-253pre3.new/fs/bio.c Wed Jan 23 17:32:59 2002
@@ -368,8 +368,6 @@
if (nr_pages > total_nr_pages)
nr_pages = total_nr_pages;

- atomic_inc(&kio->io_count);
-
/*
* allocate bio and do initial setup
*/
@@ -377,6 +375,8 @@
err = -ENOMEM;
goto out;
}
+
+ atomic_inc(&kio->io_count);

bio->bi_sector = sector;
bio->bi_dev = dev;

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