Whamcloud - gitweb
LU-2785 osc: remove unused obd methods
[fs/lustre-release.git] / lnet / utils / debug.c
index 33699ff..a0c0ce1 100644 (file)
@@ -585,11 +585,21 @@ int jt_dbg_debug_kernel(int argc, char **argv)
         /* If we are dumping raw (which means no conversion step to ASCII)
          * then dump directly to any supplied filename, otherwise this is
          * just a temp file and we dump to the real file at convert time. */
-        if (argc > 1 && raw)
-                strcpy(filename, argv[1]);
-        else
-                sprintf(filename, "%s"CFS_TIME_T".%u",
-                       LIBCFS_DEBUG_FILE_PATH_DEFAULT, time(NULL), getpid());
+       if (argc > 1 && raw) {
+               if (strlen(argv[1]) > sizeof(filename)-1) {
+                       fprintf(stderr, "File name too long: %s\n", argv[1]);
+                       return 1;
+               }
+               strncpy(filename, argv[1], sizeof(filename));
+       } else {
+               if (snprintf(filename, sizeof(filename), "%s"CFS_TIME_T".%u",
+                            LIBCFS_DEBUG_FILE_PATH_DEFAULT, time(NULL),
+                            getpid()) >=
+                   sizeof(filename)) {
+                       fprintf(stderr, "File name too long\n");
+                       return 1;
+               }
+       }
 
         if (stat(filename, &st) == 0 && S_ISREG(st.st_mode))
                 unlink(filename);
@@ -840,13 +850,11 @@ static struct mod_paths {
        { "lnet", "lnet/lnet" },
        { "kmxlnd", "lnet/klnds/mxlnd" },
        { "ko2iblnd", "lnet/klnds/o2iblnd" },
-       { "kptllnd", "lnet/klnds/ptllnd" },
        { "kgnilnd", "lnet/klnds/gnilnd"},
        { "kqswlnd", "lnet/klnds/qswlnd" },
        { "kralnd", "lnet/klnds/ralnd" },
        { "ksocklnd", "lnet/klnds/socklnd" },
        { "ktdilnd", "lnet/klnds/tdilnd" },
-       { "lvfs", "lustre/lvfs" },
        { "obdclass", "lustre/obdclass" },
        { "llog_test", "lustre/obdclass" },
        { "ptlrpc_gss", "lustre/ptlrpc/gss" },
@@ -865,7 +873,6 @@ static struct mod_paths {
        { "obdfilter", "lustre/obdfilter" },
        { "lov", "lustre/lov" },
        { "lmv", "lustre/lmv" },
-       { "fsfilt_ldiskfs", "lustre/lvfs" },
        { "lquota", "lustre/quota" },
        { "mgs", "lustre/mgs" },
        { "mgc", "lustre/mgc" },