aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/md.c66
-rw-r--r--include/linux/raid/md_p.h2
2 files changed, 62 insertions, 6 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 58be665bb46b..1f770c16d435 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1588,7 +1588,7 @@ static void print_desc(mdp_disk_t *desc)
1588 desc->major,desc->minor,desc->raid_disk,desc->state); 1588 desc->major,desc->minor,desc->raid_disk,desc->state);
1589} 1589}
1590 1590
1591static void print_sb(mdp_super_t *sb) 1591static void print_sb_90(mdp_super_t *sb)
1592{ 1592{
1593 int i; 1593 int i;
1594 1594
@@ -1619,10 +1619,57 @@ static void print_sb(mdp_super_t *sb)
1619 } 1619 }
1620 printk(KERN_INFO "md: THIS: "); 1620 printk(KERN_INFO "md: THIS: ");
1621 print_desc(&sb->this_disk); 1621 print_desc(&sb->this_disk);
1622
1623} 1622}
1624 1623
1625static void print_rdev(mdk_rdev_t *rdev) 1624static void print_sb_1(struct mdp_superblock_1 *sb)
1625{
1626 __u8 *uuid;
1627
1628 uuid = sb->set_uuid;
1629 printk(KERN_INFO "md: SB: (V:%u) (F:0x%08x) Array-ID:<%02x%02x%02x%02x"
1630 ":%02x%02x:%02x%02x:%02x%02x:%02x%02x%02x%02x%02x%02x>\n"
1631 KERN_INFO "md: Name: \"%s\" CT:%llu\n",
1632 le32_to_cpu(sb->major_version),
1633 le32_to_cpu(sb->feature_map),
1634 uuid[0], uuid[1], uuid[2], uuid[3],
1635 uuid[4], uuid[5], uuid[6], uuid[7],
1636 uuid[8], uuid[9], uuid[10], uuid[11],
1637 uuid[12], uuid[13], uuid[14], uuid[15],
1638 sb->set_name,
1639 (unsigned long long)le64_to_cpu(sb->ctime)
1640 & MD_SUPERBLOCK_1_TIME_SEC_MASK);
1641
1642 uuid = sb->device_uuid;
1643 printk(KERN_INFO "md: L%u SZ%llu RD:%u LO:%u CS:%u DO:%llu DS:%llu SO:%llu"
1644 " RO:%llu\n"
1645 KERN_INFO "md: Dev:%08x UUID: %02x%02x%02x%02x:%02x%02x:%02x%02x:%02x%02x"
1646 ":%02x%02x%02x%02x%02x%02x\n"
1647 KERN_INFO "md: (F:0x%08x) UT:%llu Events:%llu ResyncOffset:%llu CSUM:0x%08x\n"
1648 KERN_INFO "md: (MaxDev:%u) \n",
1649 le32_to_cpu(sb->level),
1650 (unsigned long long)le64_to_cpu(sb->size),
1651 le32_to_cpu(sb->raid_disks),
1652 le32_to_cpu(sb->layout),
1653 le32_to_cpu(sb->chunksize),
1654 (unsigned long long)le64_to_cpu(sb->data_offset),
1655 (unsigned long long)le64_to_cpu(sb->data_size),
1656 (unsigned long long)le64_to_cpu(sb->super_offset),
1657 (unsigned long long)le64_to_cpu(sb->recovery_offset),
1658 le32_to_cpu(sb->dev_number),
1659 uuid[0], uuid[1], uuid[2], uuid[3],
1660 uuid[4], uuid[5], uuid[6], uuid[7],
1661 uuid[8], uuid[9], uuid[10], uuid[11],
1662 uuid[12], uuid[13], uuid[14], uuid[15],
1663 sb->devflags,
1664 (unsigned long long)le64_to_cpu(sb->utime) & MD_SUPERBLOCK_1_TIME_SEC_MASK,
1665 (unsigned long long)le64_to_cpu(sb->events),
1666 (unsigned long long)le64_to_cpu(sb->resync_offset),
1667 le32_to_cpu(sb->sb_csum),
1668 le32_to_cpu(sb->max_dev)
1669 );
1670}
1671
1672static void print_rdev(mdk_rdev_t *rdev, int major_version)
1626{ 1673{
1627 char b[BDEVNAME_SIZE]; 1674 char b[BDEVNAME_SIZE];
1628 printk(KERN_INFO "md: rdev %s, SZ:%08llu F:%d S:%d DN:%u\n", 1675 printk(KERN_INFO "md: rdev %s, SZ:%08llu F:%d S:%d DN:%u\n",
@@ -1630,8 +1677,15 @@ static void print_rdev(mdk_rdev_t *rdev)
1630 test_bit(Faulty, &rdev->flags), test_bit(In_sync, &rdev->flags), 1677 test_bit(Faulty, &rdev->flags), test_bit(In_sync, &rdev->flags),
1631 rdev->desc_nr); 1678 rdev->desc_nr);
1632 if (rdev->sb_loaded) { 1679 if (rdev->sb_loaded) {
1633 printk(KERN_INFO "md: rdev superblock:\n"); 1680 printk(KERN_INFO "md: rdev superblock (MJ:%d):\n", major_version);
1634 print_sb((mdp_super_t*)page_address(rdev->sb_page)); 1681 switch (major_version) {
1682 case 0:
1683 print_sb_90((mdp_super_t*)page_address(rdev->sb_page));
1684 break;
1685 case 1:
1686 print_sb_1((struct mdp_superblock_1 *)page_address(rdev->sb_page));
1687 break;
1688 }
1635 } else 1689 } else
1636 printk(KERN_INFO "md: no rdev superblock!\n"); 1690 printk(KERN_INFO "md: no rdev superblock!\n");
1637} 1691}
@@ -1658,7 +1712,7 @@ static void md_print_devices(void)
1658 printk("\n"); 1712 printk("\n");
1659 1713
1660 list_for_each_entry(rdev, &mddev->disks, same_set) 1714 list_for_each_entry(rdev, &mddev->disks, same_set)
1661 print_rdev(rdev); 1715 print_rdev(rdev, mddev->major_version);
1662 } 1716 }
1663 printk("md: **********************************\n"); 1717 printk("md: **********************************\n");
1664 printk("\n"); 1718 printk("\n");
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h
index 8b4de4a41ff1..9491026afe66 100644
--- a/include/linux/raid/md_p.h
+++ b/include/linux/raid/md_p.h
@@ -194,6 +194,8 @@ static inline __u64 md_event(mdp_super_t *sb) {
194 return (ev<<32)| sb->events_lo; 194 return (ev<<32)| sb->events_lo;
195} 195}
196 196
197#define MD_SUPERBLOCK_1_TIME_SEC_MASK ((1ULL<<40) - 1)
198
197/* 199/*
198 * The version-1 superblock : 200 * The version-1 superblock :
199 * All numeric fields are little-endian. 201 * All numeric fields are little-endian.