From: Jens Axboe <jens.axboe@oracle.com>
To: Carl Henrik Lunde <chlunde@ping.uio.no>
Cc: fio@vger.kernel.org
Subject: Re: [bug] Crash with multiple file names
Date: Mon, 20 Apr 2009 08:41:17 +0200 [thread overview]
Message-ID: <20090420064117.GQ4593@kernel.dk> (raw)
In-Reply-To: <ed038eb20904191807h6ff3427dn83684a723c95e13c@mail.gmail.com>
On Mon, Apr 20 2009, Carl Henrik Lunde wrote:
> Hi! fio crashed with this configuration. I notice there are a
> multiple variables counting the number of files, so I don't know which
> one to use. nr_files *seems* safe?
>
> diff --git a/filesetup.c b/filesetup.c
> index af23191..eb8774a 100644
> --- a/filesetup.c
> +++ b/filesetup.c
> @@ -685,8 +685,8 @@ int add_file(struct thread_data *td, const char *fname)
>
> f->fd = -1;
>
> - if (td->files_size <= td->files_index) {
> - int new_size = td->o.nr_files;
> + if (td->files_size <= td->o.nr_files) {
> + int new_size = td->o.nr_files + 1;
>
> dprint(FD_FILE, "resize file array to %d files\n", new_size);
Woops, that is indeed an off-by-one! I have added your patch, thanks.
Your reading of the code is correct. ->o.nr_files is the total number of
files.
--
Jens Axboe
prev parent reply other threads:[~2009-04-20 6:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-20 1:07 [bug] Crash with multiple file names Carl Henrik Lunde
2009-04-20 6:41 ` Jens Axboe [this message]
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=20090420064117.GQ4593@kernel.dk \
--to=jens.axboe@oracle.com \
--cc=chlunde@ping.uio.no \
--cc=fio@vger.kernel.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.