At Fri, 29 Mar 2013 13:49:41 +0800,
Liu Yuan wrote:
> 
> +uint32_t md_get_info(struct sd_md_info *info)
> +{
> +     uint32_t ret = sizeof(*info);
> +     int i;
> +
> +     memset(info, 0, ret);
> +     pthread_rwlock_rdlock(&md_lock);
> +     for (i = 0; i < md_nr_disks; i++) {
> +             info->disk[i].idx = i;
> +             pstrcpy(info->disk[i].path, PATH_MAX, md_disks[i].path);
> +             info->disk[i].size = get_path_size(info->disk[i].path,
> +                                                &info->disk[i].used);
> +             if (!info->disk[i].size) {
> +                     ret = 0;
> +                     break;

How about removing the broken disk here and continuing the loop?  I
looks much better than returning an error to the user.

Thanks,

Kazutaka
-- 
sheepdog mailing list
sheepdog@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to