lkml.org 
[lkml]   [2004]   [Jan]   [2]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateFri, 2 Jan 2004 17:02:34 +0800
FromHugang <>
SubjectRe: [PATCH] laptop-mode-2.6.0 version 5
Organization: Beijing Soul
X-Mailer: Sylpheed version 0.9.8claws (GTK+ 1.2.10; powerpc-unknown-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

On Thu, 1 Jan 2004 19:35:45 +0100
Jens Axboe <axboe@suse.de> wrote:

> Patch is obviously bogus, just look at the comm definition in sched.h:
> 
> 	char comm[16];
> 
> IO submission must happen in process context, so we also know that
> current is valid.

You are right. But why add this patch, My laptop not crash when I enable block dump, So I try to find where is the Bug. Final, The bug is in sector_t, I was enable CONFIG_LBD, So sector_t is u64, So We have to change the code when enable CONFIG_LBD.

I'd like the 2.4 style so add count number into printf.

Here is the patch fix it
+
+   if (unlikely(block_dump)) {
+       char b[BDEVNAME_SIZE];
+       printk("%s(%d): %s block %llu/%u on %s\n",
+           current->comm, current->pid,
+           (rw & WRITE) ? "WRITE" : (rw == READA ? "READA" : "READ"),
+           (u64)bio->bi_sector, count, bdevname(bio->bi_bdev,b));
+   }
+

I think, also have this bug in 2.4.23, here is the patch for it, Hope can helpful.
Index: linux-2.4.23/drivers/block/ll_rw_blk.c
===================================================================
--- linux-2.4.23/drivers/block/ll_rw_blk.c      (revision 4)
+++ linux-2.4.23/drivers/block/ll_rw_blk.c      (working copy)
@@ -1298,7 +1298,7 @@
                wake_up(&bh->b_wait);
 
        if (block_dump)
-               printk(KERN_DEBUG "%s: %s block %lu/%u on %s\n", current->comm, rw == WRITE ? "WRITE" : "READ", bh->b_rsector, count, kdevname(bh->b_rdev));
+               printk(KERN_DEBUG "%s: %s block %llu/%u on %s\n", current->comm, rw == WRITE ? "WRITE" : "READ", (u64)bh->b_rsector, count, kdevname(bh->b_rdev));
 
        put_bh(bh);
        switch (rw) {
-- 
Hu Gang / Steve
RLU#          : 204016 [1999] (Registered Linux user)
GPG Public Key: http://soulinfo.com/~hugang/HuGang.asc
-
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/

\
 
 \ /
  Last update: 2005-03-22 12:59    [from the cache]
©2003-2008