if (sd->disk.state & (1<<MD_DISK_FAULTY))
continue;
if (sd->disk.state & (1<<MD_DISK_SYNC)) {
- char sbuf[20];
- if (sysfs_get_str(sra, sd, "state", sbuf, 20) < 0 ||
+ char sbuf[100];
+
+ if (sysfs_get_str(sra, sd, "state",
+ sbuf, sizeof(sbuf)) < 0 ||
strstr(sbuf, "faulty") ||
strstr(sbuf, "in_sync") == NULL) {
/* this device is dead */
int read_dev_state(int fd)
{
- char buf[60];
- int n = read_attr(buf, 60, fd);
+ char buf[100];
+ int n = read_attr(buf, sizeof(buf), fd);
char *cp;
int rv = 0;
if (sd->disk.state & (1<<MD_DISK_FAULTY))
continue;
if (sd->disk.state & (1<<MD_DISK_SYNC)) {
- char sbuf[20];
+ char sbuf[100];
+
if (sysfs_get_str(info,
- sd, "state", sbuf, 20) < 0 ||
+ sd, "state", sbuf, sizeof(sbuf)) < 0 ||
strstr(sbuf, "faulty") ||
strstr(sbuf, "in_sync") == NULL) {
/* this device is dead */