* [PATCH] sysfs: include faulty drive in disk count
@ 2017-11-07 15:49 Mariusz Tkaczyk
2017-11-09 20:46 ` Jes Sorensen
0 siblings, 1 reply; 4+ messages in thread
From: Mariusz Tkaczyk @ 2017-11-07 15:49 UTC (permalink / raw)
To: jsorensen; +Cc: linux-raid, Mariusz Tkaczyk
When the disk fails, it goes into faulty state first and it is removed
from the array in a while. It gives mdadm monitor a chance to see the disk
has failed and notify an event (e.g. FailSpare). It doesn't work when
sysfs is used to get a number of disks in the array as it skips faulty
disk. ioctl implementation doesn't differentiate between active and
faulty disk. Do the same for sysfs then. It should not matter that number
of disks reported is greater than list of disk structures returned by the
call because the same approach already takes place for offline disks.
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
---
sysfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sysfs.c b/sysfs.c
index bf5c8c5..df6fdda 100644
--- a/sysfs.c
+++ b/sysfs.c
@@ -307,6 +307,7 @@ struct mdinfo *sysfs_read(int fd, char *devnm, unsigned long options)
dev->disk.raid_disk = strtoul(buf, &ep, 10);
if (*ep) dev->disk.raid_disk = -1;
+ sra->array.nr_disks++;
strcpy(dbase, "block/dev");
if (load_sys(fname, buf, sizeof(buf))) {
/* assume this is a stale reference to a hot
@@ -315,7 +316,6 @@ struct mdinfo *sysfs_read(int fd, char *devnm, unsigned long options)
free(dev);
continue;
}
- sra->array.nr_disks++;
sscanf(buf, "%d:%d", &dev->disk.major, &dev->disk.minor);
/* special case check for block devices that can go 'offline' */
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] sysfs: include faulty drive in disk count
2017-11-07 15:49 [PATCH] sysfs: include faulty drive in disk count Mariusz Tkaczyk
@ 2017-11-09 20:46 ` Jes Sorensen
2017-11-13 8:09 ` Tomasz Majchrzak
0 siblings, 1 reply; 4+ messages in thread
From: Jes Sorensen @ 2017-11-09 20:46 UTC (permalink / raw)
To: Mariusz Tkaczyk; +Cc: linux-raid
On 11/07/2017 10:49 AM, Mariusz Tkaczyk wrote:
> When the disk fails, it goes into faulty state first and it is removed
> from the array in a while. It gives mdadm monitor a chance to see the disk
> has failed and notify an event (e.g. FailSpare). It doesn't work when
> sysfs is used to get a number of disks in the array as it skips faulty
> disk. ioctl implementation doesn't differentiate between active and
> faulty disk. Do the same for sysfs then. It should not matter that number
> of disks reported is greater than list of disk structures returned by the
> call because the same approach already takes place for offline disks.
>
> Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
> ---
> sysfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied!
Thanks,
Jes
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] sysfs: include faulty drive in disk count
2017-11-09 20:46 ` Jes Sorensen
@ 2017-11-13 8:09 ` Tomasz Majchrzak
2017-11-13 13:14 ` Jes Sorensen
0 siblings, 1 reply; 4+ messages in thread
From: Tomasz Majchrzak @ 2017-11-13 8:09 UTC (permalink / raw)
To: Jes Sorensen; +Cc: Mariusz Tkaczyk, linux-raid
On Thu, Nov 09, 2017 at 03:46:08PM -0500, Jes Sorensen wrote:
> On 11/07/2017 10:49 AM, Mariusz Tkaczyk wrote:
> > When the disk fails, it goes into faulty state first and it is removed
> > from the array in a while. It gives mdadm monitor a chance to see the disk
> > has failed and notify an event (e.g. FailSpare). It doesn't work when
> > sysfs is used to get a number of disks in the array as it skips faulty
> > disk. ioctl implementation doesn't differentiate between active and
> > faulty disk. Do the same for sysfs then. It should not matter that number
> > of disks reported is greater than list of disk structures returned by the
> > call because the same approach already takes place for offline disks.
> >
> > Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
> > ---
> > sysfs.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Applied!
>
> Thanks,
> Jes
Hi Jes,
Have you applied this patch? I don't see it on the repository. I see you
applied "imsm: More precise message when spanned raid is created" but you
haven't confirmed it by email.
Tomek
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] sysfs: include faulty drive in disk count
2017-11-13 8:09 ` Tomasz Majchrzak
@ 2017-11-13 13:14 ` Jes Sorensen
0 siblings, 0 replies; 4+ messages in thread
From: Jes Sorensen @ 2017-11-13 13:14 UTC (permalink / raw)
To: Tomasz Majchrzak; +Cc: Mariusz Tkaczyk, linux-raid
On 11/13/2017 03:09 AM, Tomasz Majchrzak wrote:
> On Thu, Nov 09, 2017 at 03:46:08PM -0500, Jes Sorensen wrote:
>> On 11/07/2017 10:49 AM, Mariusz Tkaczyk wrote:
>>> When the disk fails, it goes into faulty state first and it is removed
>>> from the array in a while. It gives mdadm monitor a chance to see the disk
>>> has failed and notify an event (e.g. FailSpare). It doesn't work when
>>> sysfs is used to get a number of disks in the array as it skips faulty
>>> disk. ioctl implementation doesn't differentiate between active and
>>> faulty disk. Do the same for sysfs then. It should not matter that number
>>> of disks reported is greater than list of disk structures returned by the
>>> call because the same approach already takes place for offline disks.
>>>
>>> Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
>>> ---
>>> sysfs.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> Applied!
>>
>> Thanks,
>> Jes
>
> Hi Jes,
>
> Have you applied this patch? I don't see it on the repository. I see you
> applied "imsm: More precise message when spanned raid is created" but you
> haven't confirmed it by email.
Hi Tomek,
It was there, but I had forgotten to push it. It should be in the public
repo now.
Cheers,
Jes
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-11-13 13:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-07 15:49 [PATCH] sysfs: include faulty drive in disk count Mariusz Tkaczyk
2017-11-09 20:46 ` Jes Sorensen
2017-11-13 8:09 ` Tomasz Majchrzak
2017-11-13 13:14 ` Jes Sorensen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox