[lkml]   [2003]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] Fix /sys/<dev>/<partition>/dev format: %04x -> %u:%u

(I already sent a patch to Andrew, but someone just told me that the
vanilla test3 is also affected)

In 2.6.0-test3 a part of the 64 bit kdev_t patch got merged, it changes the
format of /sys/block/<dev>/dev from %02x%02x to %u:%u. The partition could
must also be changed.

e.g. cat /sys/block/hda/hda5/dev should return 3:5 instead of 0305

This small patch adds this:

diff -Nur linux.orig/fs/partitions/check.c linux/fs/partitions/check.c
--- linux.orig/fs/partitions/check.c 2003-08-12 15:27:55.000000000 +0200
+++ linux/fs/partitions/check.c 2003-08-12 15:46:15.855390848 +0200
@@ -223,9 +223,8 @@
static ssize_t part_dev_read(struct hd_struct * p, char *page)
struct gendisk *disk = container_of(p->kobj.parent,struct gendisk,kobj);
- int part = p->partno;
- dev_t base = MKDEV(disk->major, disk->first_minor);
- return sprintf(page, "%04x\n", (unsigned)(base + part));
+ dev_t dev = MKDEV(disk->major, disk->first_minor + p->partno);
+ return print_dev_t(page, dev);
static ssize_t part_start_read(struct hd_struct * p, char *page)
Christophe Saout <>
Please avoid sending me Word or PowerPoint attachments.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:47    [W:0.199 / U:33.788 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site