i=rahul
Landing patch by Brian Behlendorf <behlendorf1@llnl.gov>,
fix libcfs_debug_file_path module option
extern cfs_duration_t libcfs_console_min_delay;
extern unsigned int libcfs_console_backoff;
extern unsigned int libcfs_debug_binary;
extern cfs_duration_t libcfs_console_min_delay;
extern unsigned int libcfs_console_backoff;
extern unsigned int libcfs_debug_binary;
-extern char libcfs_debug_file_path_arr[1024];
+extern char libcfs_debug_file_path_arr[PATH_MAX];
int libcfs_debug_mask2str(char *str, int size, int mask, int is_subsys);
int libcfs_debug_str2mask(int *mask, const char *str, int is_subsys);
int libcfs_debug_mask2str(char *str, int size, int mask, int is_subsys);
int libcfs_debug_str2mask(int *mask, const char *str, int is_subsys);
static cfs_waitq_t debug_ctlwq;
static cfs_waitq_t debug_ctlwq;
-char libcfs_debug_file_path_arr[1024] = LIBCFS_DEBUG_FILE_PATH_DEFAULT;
+char libcfs_debug_file_path_arr[PATH_MAX] = LIBCFS_DEBUG_FILE_PATH_DEFAULT;
/* We need to pass a pointer here, but elsewhere this must be a const */
/* We need to pass a pointer here, but elsewhere this must be a const */
-char *libcfs_debug_file_path = &libcfs_debug_file_path_arr[0];
+char *libcfs_debug_file_path;
CFS_MODULE_PARM(libcfs_debug_file_path, "s", charp, 0644,
"Path for dumping debug logs, "
"set 'NONE' to prevent log dumping");
CFS_MODULE_PARM(libcfs_debug_file_path, "s", charp, 0644,
"Path for dumping debug logs, "
"set 'NONE' to prevent log dumping");
libcfs_console_min_delay = CDEBUG_DEFAULT_MIN_DELAY;
}
libcfs_console_min_delay = CDEBUG_DEFAULT_MIN_DELAY;
}
+ if (libcfs_debug_file_path != NULL) {
+ memset(libcfs_debug_file_path_arr, 0, PATH_MAX);
+ strncpy(libcfs_debug_file_path_arr,
+ libcfs_debug_file_path, PATH_MAX-1);
+ }
+
/* If libcfs_debug_mb is set to an invalid value or uninitialized
* then just make the total buffers smp_num_cpus * TCD_MAX_PAGES */
if (max > cfs_trace_max_debug_mb() || max < cfs_num_possible_cpus()) {
/* If libcfs_debug_mb is set to an invalid value or uninitialized
* then just make the total buffers smp_num_cpus * TCD_MAX_PAGES */
if (max > cfs_trace_max_debug_mb() || max < cfs_num_possible_cpus()) {
#include <linux/kallsyms.h>
#endif
#include <linux/kallsyms.h>
#endif
-/* We need to pass a pointer here, but elsewhere this must be a const */
-static char *debug_file_path = &libcfs_debug_file_path_arr[0];
-CFS_MODULE_PARM(debug_file_path, "s", charp, 0644,
- "Path for dumping debug logs (deprecated)");
-
char lnet_upcall[1024] = "/usr/lib/lustre/lnet_upcall";
char lnet_debug_log_upcall[1024] = "/usr/lib/lustre/lnet_debug_log_upcall";
char lnet_upcall[1024] = "/usr/lib/lustre/lnet_upcall";
char lnet_debug_log_upcall[1024] = "/usr/lib/lustre/lnet_debug_log_upcall";