From: Takao Indoh <indou.takao@soft.fujitsu.com>
To: arjanv@redhat.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4]Diskdump Update
Date: Fri, 11 Jun 2004 22:40:53 +0900 [thread overview]
Message-ID: <ABC44FB9B74DDCindou.takao@soft.fujitsu.com> (raw)
In-Reply-To: <1086954645.2731.23.camel@laptop.fenrus.com>
Hi,
On Fri, 11 Jun 2004 13:50:45 +0200, Arjan van de Ven wrote:
>> console_verbose();
>> - spin_lock_irq(&die_lock);
>> + if (!crashdump_mode())
>> + spin_lock_irq(&die_lock);
>
>
>why is this??
It is for safety.
If diskdump dies during dumping, die() is called again.
In such a case, system falls into the deadlock by die_lock.
User cannot't know what happened to diskdump.
By this correction, spin_lock_irq() is skipped and show_registers()
shows stack trace. User may be able to know what happened even if dump
fails.
>
>
>> +#ifndef TRUE
>> +#define TRUE 1
>> +#endif
>> +#ifndef FALSE
>> +#define FALSE 0
>> +#endif
>
>it's kernel convention to just use 0 and !0
OK.
>
>> +MODULE_PARM(fallback_on_err, "i");
>> +MODULE_PARM(allow_risky_dumps, "i");
>> +MODULE_PARM(block_order, "i");
>> +MODULE_PARM(sample_rate, "i");
>
>please exclusively use the 2.6 module parameter mechanism for new code.
I see. I'll change this code using __setup.
>> + page = mem_map + nr;
>
>this is not safe for discontig mem and thus broken
Ok, I fix it.
- page = mem_map + nr;
+ page = pfn_to_page(nr);
I also need fix this.
- for (nr = 0; nr < max_mapnr; nr++) {
+ for (nr = 0; nr < max_pfn; nr++) {
>> + /*
>> + * Check the checksum of myself
>> + */
>> + spin_trylock(&disk_dump_lock);
>
>you need to handle the failure case of trylock of course
I see, thanks.
>> +#ifdef CONFIG_PROC_FS
>> +static int proc_ioctl(struct inode *inode, struct file *file, unsigned
>> int cmd, unsigned long param)
>
>
>ehhh this looks evil
Sorry, but would you please explain?
>> diff -Nur linux-2.6.6.org/drivers/block/genhd.c linux-2.6.6/drivers/block
>> /genhd.c
>> --- linux-2.6.6.org/drivers/block/genhd.c 2004-05-10 11:32:29.000000000
+>> 0900
>> +++ linux-2.6.6/drivers/block/genhd.c 2004-06-09 19:17:46.000000000 +
0900
>> @@ -224,6 +224,8 @@
>> return kobj ? to_disk(kobj) : NULL;
>> }
>>
>> +EXPORT_SYMBOL(get_gendisk);
>
>
>this is WRONG. VERY WRONG.
I used get_gendisk() to get gendisk from inode.
gd = get_gendisk(inode->i_rdev, &part);
But, I can get gendiskd by i_bdev->bd_disk, so this export
is not needed. I remove it.
Best Regards,
Takao Indoh
next prev parent reply other threads:[~2004-06-11 13:39 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-11 11:34 [PATCH 0/4]Diskdump Update Takao Indoh
2004-06-11 11:40 ` [PATCH 1/4]Diskdump Update Takao Indoh
2004-06-11 11:50 ` Arjan van de Ven
2004-06-11 13:40 ` Takao Indoh [this message]
2004-06-11 15:17 ` Martin J. Bligh
2004-06-14 1:38 ` Takao Indoh
2004-06-14 2:08 ` Martin J. Bligh
2004-06-21 7:59 ` Takao Indoh
2004-06-21 8:01 ` Arjan van de Ven
2004-06-22 10:57 ` Takao Indoh
2004-06-21 8:02 ` Christoph Hellwig
2004-06-11 11:41 ` [PATCH 2/4]Diskdump Update Takao Indoh
2004-06-17 12:49 ` Christoph Hellwig
2004-06-17 13:21 ` Takao Indoh
2004-06-17 13:39 ` Christoph Hellwig
2004-06-22 12:01 ` Takao Indoh
2004-06-22 12:12 ` Christoph Hellwig
2004-06-23 1:47 ` Takao Indoh
2004-06-11 11:42 ` [PATCH 3/4]Diskdump Update Takao Indoh
2004-06-11 11:43 ` [PATCH 4/4]Diskdump Update Takao Indoh
2004-06-14 14:20 ` [PATCH 0/4]Diskdump Update Takao Indoh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ABC44FB9B74DDCindou.takao@soft.fujitsu.com \
--to=indou.takao@soft.fujitsu.com \
--cc=arjanv@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®