Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / utils / llog_reader.c
index 9f89adc..ae62a39 100644 (file)
@@ -16,8 +16,8 @@
  * in the LICENSE file that accompanied this code).
  *
  * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see [sun.com URL with a
- * copy of GPLv2].
+ * version 2 along with this program; If not, see
+ * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
  *
  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  * CA 95054 USA or visit www.sun.com if you need additional information or
@@ -363,9 +363,15 @@ void print_lustre_cfg(struct lustre_cfg *lcfg, int *skip)
                 print_1_cfg(lcfg);
                 break;
         }
+        case(LCFG_SPTLRPC_CONF):{
+                printf("sptlrpc_conf ");
+                print_1_cfg(lcfg);
+                break;
+        }
         case(LCFG_MARKER):{
                 struct cfg_marker *marker = lustre_cfg_buf(lcfg, 1);
                 char createtime[26], canceltime[26] = "";
+                time_t time_tmp;
 
                 if (marker->cm_flags & CM_SKIP) {
                         if (marker->cm_flags & CM_START) {
@@ -376,18 +382,39 @@ void print_lustre_cfg(struct lustre_cfg *lcfg, int *skip)
                                 *skip = 0;
                         }
                 }
+
                 if (marker->cm_flags & CM_EXCLUDE) {
                         if (marker->cm_flags & CM_START) 
                                 printf("EXCLUDE START ");
                         else
                                 printf("EXCLUDE END   ");
                 }
-                ctime_r(&marker->cm_createtime, createtime);
-                createtime[strlen(createtime) - 1] = 0;
+
+                /* Handle overflow of 32-bit time_t gracefully.
+                 * The copy to time_tmp is needed in any case to
+                 * keep the pointer happy, even on 64-bit systems. */
+                time_tmp = marker->cm_createtime;
+                if (time_tmp == marker->cm_createtime) {
+                        ctime_r(&time_tmp, createtime);
+                        createtime[strlen(createtime) - 1] = 0;
+                } else {
+                        strcpy(createtime, "in the distant future");
+                }
+
                 if (marker->cm_canceltime) {
-                        ctime_r(&marker->cm_canceltime, canceltime);
-                        canceltime[strlen(canceltime) - 1] = 0;
+                        /* Like cm_createtime, we try to handle overflow of
+                         * 32-bit time_t gracefully. The copy to time_tmp
+                         * is also needed on 64-bit systems to keep the
+                         * pointer happy, see bug 16771 */
+                        time_tmp = marker->cm_canceltime;
+                        if (time_tmp == marker->cm_canceltime) {
+                                ctime_r(&time_tmp, canceltime);
+                                canceltime[strlen(canceltime) - 1] = 0;
+                        } else {
+                                strcpy(canceltime, "in the distant future");
+                        }
                 }
+
                 printf("marker %3d (flags=%#04x, v%d.%d.%d.%d) %-15s '%s' %s-%s",
                        marker->cm_step, marker->cm_flags,
                        OBD_OCD_VERSION_MAJOR(marker->cm_vers),
@@ -398,6 +425,26 @@ void print_lustre_cfg(struct lustre_cfg *lcfg, int *skip)
                        createtime, canceltime);
                 break;
         }
+        case(LCFG_POOL_NEW):{
+                printf("pool new ");
+                print_1_cfg(lcfg);
+                break;
+        }
+        case(LCFG_POOL_ADD):{
+                printf("pool add ");
+                print_1_cfg(lcfg);
+                break;
+        }
+        case(LCFG_POOL_REM):{
+                printf("pool remove ");
+                print_1_cfg(lcfg);
+                break;
+        }
+        case(LCFG_POOL_DEL):{
+                printf("pool destroy ");
+                print_1_cfg(lcfg);
+                break;
+        }
         default:
                 printf("unsupported cmd_code = %x\n",cmd);
         }