Whamcloud - gitweb
b=11063
authorvs <vs>
Thu, 23 Oct 2008 14:20:03 +0000 (14:20 +0000)
committervs <vs>
Thu, 23 Oct 2008 14:20:03 +0000 (14:20 +0000)
i=green,vitaly
this patch reverses
https://bugzilla.lustre.org/attachment.cgi?id=7933
https://bugzilla.lustre.org/attachment.cgi?id=7882
https://bugzilla.lustre.org/attachment.cgi?id=15831
and replaces them with setting mtime to past under extent lock

sanity test (39c) is added to check original problem
i=adilger,grev

lustre/utils/lustre_cfg.c

index 9844c13..36608d3 100644 (file)
@@ -745,7 +745,12 @@ int jt_lcfg_setparam(int argc, char **argv)
                 }
                 /* Write the new value to the file */
                 fp = open(glob_info.gl_pathv[i], O_WRONLY);
-                if (fp > 0) {
+                if (fp == -1) {
+                        fprintf(stderr, "error: %s: %s opening %s\n",
+                                jt_cmdname(argv[0]), strerror(rc = errno),
+                                glob_info.gl_pathv[i]);
+                        break;
+                } else {
                         rc = write(fp, value, strlen(value));
                         if (rc < 0)
                                 fprintf(stderr,
@@ -754,10 +759,6 @@ int jt_lcfg_setparam(int argc, char **argv)
                         else
                                 rc = 0;
                         close(fp);
-                } else {
-                        fprintf(stderr, "error: %s: %s opening %s\n",
-                                jt_cmdname(argv[0]), strerror(rc = errno),
-                                glob_info.gl_pathv[i]);
                 }
         }