Skip to contentSkip to conversation

lustre: initialize libcfs_debug_file_path

PATCH New NeilBrown 2 participants 5 messages Oct 26, 2018 – Oct 29, 2018 Staging

lore
Share & tools
lore

NeilBrown

author
#0 lore raw

PATCH 1/1 lustre: initialize libcfs_debug_file_path

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.

---

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(-)
drivers/staging/lustre/lnet/libcfs/debug.c +1 -1
index 90d756c83520..f9544367389d 100644
@@ -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");
Signature · 9 lines
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>
author
#1 lore raw

PATCH 1/1 lustre: accept suffix when parsing max_pages_per_rpc

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

---

This fixes test 101g.

 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +4 -3
index edac88440b41..feba2ef5a3bc 100644
@@ -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)
Signature · 9 lines
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>
#2 lore raw

PATCH 1/1 lustre: accept suffix when parsing max_pages_per_rpc

Quoted 8 lines

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

---

This fixes test 101g.

Quoted 27 lines
 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +4 -3
index edac88440b41..feba2ef5a3bc 100644
@@ -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)
Signature · 1 line
2.14.0.rc0.dirty
#3 lore raw

PATCH 1/1 lustre: initialize libcfs_debug_file_path

In reply to NeilBrown
Quoted 11 lines

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.

---

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

Quoted 20 lines
 drivers/staging/lustre/lnet/libcfs/debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lnet/libcfs/debug.c +1 -1
index 90d756c83520..f9544367389d 100644
@@ -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");
Signature · 1 line
2.14.0.rc0.dirty
author
#4 lore raw

PATCH 1/1 lustre: initialize libcfs_debug_file_path

Quoted 5 lines · James Simmons
Quoted 5 lines

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.

Quoted 7 lines
Quoted 5 lines

---

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

Thanks for these two reviews.

NeilBrown

Quoted 11 lines
Quoted 11 lines
 
 drivers/staging/lustre/lnet/libcfs/debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lnet/libcfs/debug.c +0 -0
index 90d756c83520..f9544367389d 100644
@@ -224,7 +224,7 @@ char libcfs_debug_file_path_arr[PATH_MAX] = LIBCFS_DEBUG_FILE_PATH_DEFAULT;
 EXPORT_SYMBOL(libcfs_debug_file_path_arr);
 
Quoted 10 lines
Quoted 10 lines
drivers/staging/lustre/lnet/libcfs/debug.c +1 -1
 /* 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");
Signature · 1 line
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>