+ globfree(&glob_info);
+ return -EINVAL;
+ }
+
+ /* Chop off "/dev" from path we found */
+ path[strlen(glob_info.gl_pathv[i])] = '\0';
+ globfree(&glob_info);
+
+set_params:
+ if (strncmp(real_path, "/dev/md", 7) == 0) {
+ snprintf(real_path, sizeof(real_path), "%s/%s", path,
+ STRIPE_CACHE_SIZE);
+
+ rc = read_file(real_path, buf, sizeof(buf));
+ if (rc) {
+ if (verbose)
+ fprintf(stderr, "warning: opening %s: %s\n",
+ real_path, strerror(errno));
+ return rc;
+ }
+
+ if (atoi(buf) >= md_stripe_cache_size)
+ return 0;
+
+ if (strlen(buf) - 1 > 0) {
+ snprintf(buf, sizeof(buf), "%d", md_stripe_cache_size);
+ rc = write_file(real_path, buf);
+ if (rc && verbose)
+ fprintf(stderr, "warning: opening %s: %s\n",
+ real_path, strerror(errno));
+ }
+ /* Return since raid and disk tunables are different */
+ return rc;