All of lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: lustre-devel@lists.lustre.org
Subject: [lustre-devel] [PATCH] lustre: accept suffix when parsing max_pages_per_rpc
Date: Fri, 26 Oct 2018 14:33:55 +1100	[thread overview]
Message-ID: <87va5p4c0s.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <87y3al4hb9.fsf@notabene.neil.brown.name>


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>

  reply	other threads:[~2018-10-26  3:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-26  1:39 [lustre-devel] [PATCH] lustre: initialize libcfs_debug_file_path NeilBrown
2018-10-26  3:33 ` NeilBrown [this message]
2018-10-29  3:37   ` [lustre-devel] [PATCH] lustre: accept suffix when parsing max_pages_per_rpc James Simmons
2018-10-29  3:32 ` [lustre-devel] [PATCH] lustre: initialize libcfs_debug_file_path James Simmons
2018-10-29  4:34   ` NeilBrown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87va5p4c0s.fsf@notabene.neil.brown.name \
    --to=neilb@suse.com \
    --cc=lustre-devel@lists.lustre.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.