Flexible I/O Tester development
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>, fio@vger.kernel.org
Subject: Re: [PATCH] client: parse env variables before sending job-file contents to server
Date: Fri, 15 Jun 2018 08:55:59 -0600	[thread overview]
Message-ID: <2f9dbd9e-1582-a702-8255-e4d467b6afa2@kernel.dk> (raw)
In-Reply-To: <1529075486-18805-1-git-send-email-kusumi.tomohiro@gmail.com>

On 6/15/18 9:11 AM, Tomohiro Kusumi wrote:
> Fixes "fio environment var bug".
> https://www.spinics.net/lists/fio/msg07093.html
> 
> Add read_ini_data() to parse and expand env variables within job-file
> before sending to server. By doing this, clients can control parameters
> embedded within the job-file, without server side having to set them
> separately.

Looks good to me, just one minor comment:

> +static int read_ini_data(int fd, void *data, size_t size)
> +{
> +	char *p = data;
> +	int ret = 0;
> +
> +	FILE *fp = fdopen(dup(fd), "r");
> +	if (!fp)
> +		return errno;
> +
> +	while (1) {
> +		ssize_t len;
> +		char buf[OPT_LEN_MAX+1], *sub;
> +
> +		if (!fgets(buf, sizeof(buf), fp)) {
> +			if (ferror(fp)) {
> +				if (errno == EAGAIN || errno == EINTR)
> +					continue;
> +				ret = errno;
> +				break;
> +			} else
> +				break;
> +		}

This should just be:

		if (!fgets(buf, sizeof(buf), fp)) {
			if (ferror(fp)) {
				if (errno == EAGAIN || errno == EINTR)
					continue;
				ret = errno;
			}
			break;
		}

I'll make that change while applying.

-- 
Jens Axboe



  reply	other threads:[~2018-06-15 14:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-15 15:11 [PATCH] client: parse env variables before sending job-file contents to server Tomohiro Kusumi
2018-06-15 14:55 ` Jens Axboe [this message]
2018-06-15 17:47   ` Jeff Furlong

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=2f9dbd9e-1582-a702-8255-e4d467b6afa2@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=fio@vger.kernel.org \
    --cc=kusumi.tomohiro@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox