2002-01-01 23:37:11

by Jeff Garzik

[permalink] [raw]
Subject: PATCH 2.5.2.6: fix up serial, sysrq

diff -u -r1.4 serial.c
--- drivers/char/serial.c 2002/01/01 22:41:09 1.4
+++ drivers/char/serial.c 2002/01/01 23:19:45
@@ -5827,7 +5827,7 @@

static kdev_t serial_console_device(struct console *c)
{
- return MKDEV(TTY_MAJOR, 64 + c->index);
+ return mk_kdev(TTY_MAJOR, 64 + c->index);
}

/*
diff -u -r1.2 sysrq.c
--- drivers/char/sysrq.c 2001/12/11 04:04:49 1.2
+++ drivers/char/sysrq.c 2002/01/01 23:19:45
@@ -105,7 +105,7 @@
/* Guesses if the device is a local hard drive */
static int is_local_disk(kdev_t dev) {
unsigned int major;
- major = MAJOR(dev);
+ major = major(dev);

switch (major) {
case IDE0_MAJOR:
@@ -206,7 +206,7 @@
for (sb = sb_entry(super_blocks.next);
sb != sb_entry(&super_blocks);
sb = sb_entry(sb->s_list.next))
- if (!is_local_disk(sb->s_dev) && MAJOR(sb->s_dev))
+ if (!is_local_disk(sb->s_dev) && !kdev_none(sb->s_dev))
go_sync(sb, remount_flag);

unlock_kernel();


Attachments:
char.patch (934.00 B)

2002-01-03 02:37:17

by Andries E. Brouwer

[permalink] [raw]
Subject: Re: PATCH 2.5.2.6: fix up serial, sysrq

From: Jeff Garzik <[email protected]>

The kdev_none change might not be correct, please check.

Indeed, I would say it is not.

- if (!is_local_disk(sb->s_dev) && MAJOR(sb->s_dev))
+ if (!is_local_disk(sb->s_dev) && !kdev_none(sb->s_dev))
go_sync(sb, remount_flag);

Without studying the surrounding code, I conjecture that
the test MAJOR(sb->s_dev) was meant to exclude anonymous
devices (with major 0), not only NODEV.

Andries