| To: | cousins@xxxxxxxxxxxxxx |
|---|---|
| Subject: | Re: swidth with mdadm and RAID6 |
| From: | Shailendra Tripathi <stripathi@xxxxxxxxx> |
| Date: | Tue, 19 Sep 2006 03:43:51 +0530 |
| Cc: | "\"xfs@xxxxxxxxxxx\" <xfs@xxxxxxxxxxx>" <xfs@xxxxxxxxxxx> |
| In-reply-to: | <Pine.LNX.4.10.10609181639000.1732-100000@limpet.umeoce.maine.edu> |
| References: | <Pine.LNX.4.10.10609181639000.1732-100000@limpet.umeoce.maine.edu> |
| Sender: | xfs-bounce@xxxxxxxxxxx |
| User-agent: | Mozilla Thunderbird 1.0.6 (Windows/20050716) |
|
Hi Steve, Your guess appears to be correct. md_ioctl returns nr which is total number of disk in the array including the spare disks. However, XFS function md_get_vol_stripe does not take spare disk into account. It needs to subtract spare_disks as well. However, md.spare_disks returned by the call returns spare + parity (both). So, one way could be substract spare_disks directly. Otherwise, the xfs should rely on md.raid_disks. This does not include spare_disks and nr.disks should be changed for that. When I run my program md_info on raid5 array with 5 devices and 2 spares, I get [root@ga09 root]# ./a.out /dev/md11 Level 5, disks=7 spare_disks=3 raid_disks=5 Steve can you please compile the pasted program and run on your system with md prepared. It takes /dev/md<no> as input. In your case, you should get above line as: Level 6, disks=11 spare disks=3 raid_disks=10 nr=working=active=failed=spare=0;
ITERATE_RDEV(mddev,rdev,tmp) {
nr++;
if (rdev->faulty)
failed++;
else {
working++;
if (rdev->in_sync)
active++;
else
spare++;
}
} info.level = mddev->level;
info.size = mddev->size;
info.nr_disks = nr;
....
info.active_disks = active;
info.working_disks = working;
info.failed_disks = failed;
info.spare_disks = spare;-shailendra The program is pasted below: md_info.c. Takes /dev/md<no> as name. For example, /dev/md11. #include<stdio.h> #include<fcntl.h> #include<sys/ioctl.h> #ifndef MD_MAJOR #define MD_MAJOR 9 #endif #define GET_ARRAY_INFO _IOR (MD_MAJOR, 0x11, struct md_array_info)
}; int main(int argc, char *argv[])
{
struct md_array_info md;
int fd;/* Open device */ fd = open(argv[1], O_RDONLY); if (fd == -1) { printf("Could not open %s\n", argv[1]); exit(1); } if (ioctl(fd, GET_ARRAY_INFO, &md)) { printf("Error getting MD array info from %s\n", argv[1]); exit(1); } close(fd); printf("Level %d, disks=%d spare_disks=%d raid_disks=%d\n", md.level, md.nr_disks, md.spare_disks, md.raid_disks); return 0; } |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: File system block reservation mechanism is broken, David Chinner |
|---|---|
| Next by Date: | Re: xfs_check - out of memory | xfs_repair - superblock error reading, Stephan Jansen |
| Previous by Thread: | Re: swidth with mdadm and RAID6, Shailendra Tripathi |
| Next by Thread: | Re: swidth with mdadm and RAID6, Timothy Shimmin |
| Indexes: | [Date] [Thread] [Top] [All Lists] |