All of lore.kernel.org
 help / color / mirror / Atom feed
* [lustre-devel] [PATCH] lustre: initialize libcfs_debug_file_path
@ 2018-10-26  1:39 NeilBrown
  2018-10-26  3:33 ` [lustre-devel] [PATCH] lustre: accept suffix when parsing max_pages_per_rpc NeilBrown
  2018-10-29  3:32 ` [lustre-devel] [PATCH] lustre: initialize libcfs_debug_file_path James Simmons
  0 siblings, 2 replies; 5+ messages in thread
From: NeilBrown @ 2018-10-26  1:39 UTC (permalink / raw)
  To: lustre-devel


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(-)

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.lustre.org/pipermail/lustre-devel-lustre.org/attachments/20181026/457e3ef3/attachment.sig>

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [lustre-devel] [PATCH] lustre: accept suffix when parsing max_pages_per_rpc
  2018-10-26  1:39 [lustre-devel] [PATCH] lustre: initialize libcfs_debug_file_path NeilBrown
@ 2018-10-26  3:33 ` NeilBrown
  2018-10-29  3:37   ` James Simmons
  2018-10-29  3:32 ` [lustre-devel] [PATCH] lustre: initialize libcfs_debug_file_path James Simmons
  1 sibling, 1 reply; 5+ messages in thread
From: NeilBrown @ 2018-10-26  3:33 UTC (permalink / raw)
  To: lustre-devel


upstream lustre allows size suffixes (K, M, G, etc) for
max_pages_per_rpc.  We should too.

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

This fixes test 101g.

 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index edac88440b41..feba2ef5a3bc 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -1868,11 +1868,12 @@ ssize_t max_pages_per_rpc_store(struct kobject *kobj, struct attribute *attr,
 	struct obd_connect_data *ocd;
 	unsigned long long val;
 	int chunk_mask;
+	char *endp;
 	int rc;
 
-	rc = kstrtoull(buffer, 10, &val);
-	if (rc)
-		return rc;
+	val = memparse(buffer, &endp);
+	if (*endp)
+		return -EINVAL;
 
 	/* if the max_pages is specified in bytes, convert to pages */
 	if (val >= ONE_MB_BRW_SIZE)
-- 
2.14.0.rc0.dirty

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.lustre.org/pipermail/lustre-devel-lustre.org/attachments/20181026/9c53a85c/attachment.sig>

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [lustre-devel] [PATCH] lustre: initialize libcfs_debug_file_path
  2018-10-26  1:39 [lustre-devel] [PATCH] lustre: initialize libcfs_debug_file_path NeilBrown
  2018-10-26  3:33 ` [lustre-devel] [PATCH] lustre: accept suffix when parsing max_pages_per_rpc NeilBrown
@ 2018-10-29  3:32 ` James Simmons
  2018-10-29  4:34   ` NeilBrown
  1 sibling, 1 reply; 5+ messages in thread
From: James Simmons @ 2018-10-29  3:32 UTC (permalink / raw)
  To: lustre-devel


> 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
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [lustre-devel] [PATCH] lustre: accept suffix when parsing max_pages_per_rpc
  2018-10-26  3:33 ` [lustre-devel] [PATCH] lustre: accept suffix when parsing max_pages_per_rpc NeilBrown
@ 2018-10-29  3:37   ` James Simmons
  0 siblings, 0 replies; 5+ messages in thread
From: James Simmons @ 2018-10-29  3:37 UTC (permalink / raw)
  To: lustre-devel


> upstream lustre allows size suffixes (K, M, G, etc) for
> max_pages_per_rpc.  We should too.
> 
> Signed-off-by: NeilBrown <neilb@suse.com>
> ---
> 
> This fixes test 101g.

Reviewed-by: James Simmons <jsimmons@infradead.org>
 
>  drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
> index edac88440b41..feba2ef5a3bc 100644
> --- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
> +++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
> @@ -1868,11 +1868,12 @@ ssize_t max_pages_per_rpc_store(struct kobject *kobj, struct attribute *attr,
>  	struct obd_connect_data *ocd;
>  	unsigned long long val;
>  	int chunk_mask;
> +	char *endp;
>  	int rc;
>  
> -	rc = kstrtoull(buffer, 10, &val);
> -	if (rc)
> -		return rc;
> +	val = memparse(buffer, &endp);
> +	if (*endp)
> +		return -EINVAL;
>  
>  	/* if the max_pages is specified in bytes, convert to pages */
>  	if (val >= ONE_MB_BRW_SIZE)
> -- 
> 2.14.0.rc0.dirty
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [lustre-devel] [PATCH] lustre: initialize libcfs_debug_file_path
  2018-10-29  3:32 ` [lustre-devel] [PATCH] lustre: initialize libcfs_debug_file_path James Simmons
@ 2018-10-29  4:34   ` NeilBrown
  0 siblings, 0 replies; 5+ messages in thread
From: NeilBrown @ 2018-10-29  4:34 UTC (permalink / raw)
  To: lustre-devel

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
>> 
>> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.lustre.org/pipermail/lustre-devel-lustre.org/attachments/20181029/65b8ff0c/attachment.sig>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-10-29  4:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-26  1:39 [lustre-devel] [PATCH] lustre: initialize libcfs_debug_file_path NeilBrown
2018-10-26  3:33 ` [lustre-devel] [PATCH] lustre: accept suffix when parsing max_pages_per_rpc NeilBrown
2018-10-29  3:37   ` James Simmons
2018-10-29  3:32 ` [lustre-devel] [PATCH] lustre: initialize libcfs_debug_file_path James Simmons
2018-10-29  4:34   ` NeilBrown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.