lustre: initialize libcfs_debug_file_path
diff mbox series

Message ID 87y3al4hb9.fsf@notabene.neil.brown.name
State New
Headers show
Series
  • lustre: initialize libcfs_debug_file_path
Related show

Commit Message

NeilBrown Oct. 26, 2018, 1:39 a.m. UTC
This variable is assumed by the code to either
be "NONE" or a file name - it shouldn't be NULL.

So initialise to the compiled default.

Signed-off-by: NeilBrown <neilb@suse.com>
---

I'm going though failed tests, looking for things to fix.
This fixes 77c.

 drivers/staging/lustre/lnet/libcfs/debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

James Simmons Oct. 29, 2018, 3:32 a.m. UTC | #1
> This variable is assumed by the code to either
> be "NONE" or a file name - it shouldn't be NULL.
> 
> So initialise to the compiled default.
> 
> Signed-off-by: NeilBrown <neilb@suse.com>
> ---
> 
> I'm going though failed tests, looking for things to fix.
> This fixes 77c.

Reviewed-by: James Simmons <jsimmons@infradead.org>
 
>  drivers/staging/lustre/lnet/libcfs/debug.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/lustre/lnet/libcfs/debug.c b/drivers/staging/lustre/lnet/libcfs/debug.c
> index 90d756c83520..f9544367389d 100644
> --- a/drivers/staging/lustre/lnet/libcfs/debug.c
> +++ b/drivers/staging/lustre/lnet/libcfs/debug.c
> @@ -224,7 +224,7 @@ char libcfs_debug_file_path_arr[PATH_MAX] = LIBCFS_DEBUG_FILE_PATH_DEFAULT;
>  EXPORT_SYMBOL(libcfs_debug_file_path_arr);
>  
>  /* We need to pass a pointer here, but elsewhere this must be a const */
> -static char *libcfs_debug_file_path;
> +static char *libcfs_debug_file_path = LIBCFS_DEBUG_FILE_PATH_DEFAULT;
>  module_param(libcfs_debug_file_path, charp, 0644);
>  MODULE_PARM_DESC(libcfs_debug_file_path,
>  		 "Path for dumping debug logs, set 'NONE' to prevent log dumping");
> -- 
> 2.14.0.rc0.dirty
> 
>
NeilBrown Oct. 29, 2018, 4:34 a.m. UTC | #2
On Mon, Oct 29 2018, James Simmons wrote:

>> This variable is assumed by the code to either
>> be "NONE" or a file name - it shouldn't be NULL.
>> 
>> So initialise to the compiled default.
>> 
>> Signed-off-by: NeilBrown <neilb@suse.com>
>> ---
>> 
>> I'm going though failed tests, looking for things to fix.
>> This fixes 77c.
>
> Reviewed-by: James Simmons <jsimmons@infradead.org>

Thanks for these two reviews.

NeilBrown

>  
>>  drivers/staging/lustre/lnet/libcfs/debug.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/staging/lustre/lnet/libcfs/debug.c b/drivers/staging/lustre/lnet/libcfs/debug.c
>> index 90d756c83520..f9544367389d 100644
>> --- a/drivers/staging/lustre/lnet/libcfs/debug.c
>> +++ b/drivers/staging/lustre/lnet/libcfs/debug.c
>> @@ -224,7 +224,7 @@ char libcfs_debug_file_path_arr[PATH_MAX] = LIBCFS_DEBUG_FILE_PATH_DEFAULT;
>>  EXPORT_SYMBOL(libcfs_debug_file_path_arr);
>>  
>>  /* We need to pass a pointer here, but elsewhere this must be a const */
>> -static char *libcfs_debug_file_path;
>> +static char *libcfs_debug_file_path = LIBCFS_DEBUG_FILE_PATH_DEFAULT;
>>  module_param(libcfs_debug_file_path, charp, 0644);
>>  MODULE_PARM_DESC(libcfs_debug_file_path,
>>  		 "Path for dumping debug logs, set 'NONE' to prevent log dumping");
>> -- 
>> 2.14.0.rc0.dirty
>> 
>>

Patch
diff mbox series

diff --git a/drivers/staging/lustre/lnet/libcfs/debug.c b/drivers/staging/lustre/lnet/libcfs/debug.c
index 90d756c83520..f9544367389d 100644
--- a/drivers/staging/lustre/lnet/libcfs/debug.c
+++ b/drivers/staging/lustre/lnet/libcfs/debug.c
@@ -224,7 +224,7 @@  char libcfs_debug_file_path_arr[PATH_MAX] = LIBCFS_DEBUG_FILE_PATH_DEFAULT;
 EXPORT_SYMBOL(libcfs_debug_file_path_arr);
 
 /* We need to pass a pointer here, but elsewhere this must be a const */
-static char *libcfs_debug_file_path;
+static char *libcfs_debug_file_path = LIBCFS_DEBUG_FILE_PATH_DEFAULT;
 module_param(libcfs_debug_file_path, charp, 0644);
 MODULE_PARM_DESC(libcfs_debug_file_path,
 		 "Path for dumping debug logs, set 'NONE' to prevent log dumping");