Flexible I/O Tester development
 help / color / mirror / Atom feed
From: "Luís Henriques" <lhenriques@suse.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: fio@vger.kernel.org
Subject: Re: [PATCH] fio: make sure io_u->file isn't NULL before using it
Date: Mon, 11 Oct 2021 14:44:19 +0100	[thread overview]
Message-ID: <YWQ/s44zyPC/ULBi@suse.de> (raw)
In-Reply-To: <42aee776-323c-634f-d950-9792de7724d2@kernel.dk>

On Mon, Oct 11, 2021 at 06:58:52AM -0600, Jens Axboe wrote:
> On 10/11/21 4:27 AM, Luís Henriques wrote:
> > While running fstests generic/095 against ext4 on a zram device I started
> > seeing fio crashing.  Fix it by making sure io_u->file isn't NULL before
> > accessing it.
> > 
> > Signed-off-by: Luís Henriques <lhenriques@suse.de>
> > ---
> >  io_u.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/io_u.c b/io_u.c
> > index 5289b5d1d9c6..b8e715d4118c 100644
> > --- a/io_u.c
> > +++ b/io_u.c
> > @@ -2009,7 +2009,8 @@ static void io_completed(struct thread_data *td, struct io_u **io_u_ptr,
> >  			io_u->xfer_buf += bytes;
> >  			io_u->offset += bytes;
> >  			td->ts.short_io_u[io_u->ddir]++;
> > -			if (io_u->offset < io_u->file->real_file_size) {
> > +			if (io_u->file &&
> > +			    (io_u->offset < io_u->file->real_file_size)) {
> >  				requeue_io_u(td, io_u_ptr);
> >  				return;
> >  			}
> 
> This will prevent the crash, but I'm wondering why io_u-> == NULL for this case.
> It really should be a valid file.
> 
> Can you let me know exactly how you're reproducing this? Then I'll give it
> a whirl too.

Sure, here's my recipe for reproducing this bug:

 # modprobe zram num_devices=2
 # echo 1G > /sys/block/zram0/disksize 
 # echo 1G > /sys/block/zram1/disksize 
 # mkfs.ext4 /dev/zram0
 # mkfs.ext4 /dev/zram1

 # ./check generic/095

Cheers,
--
Luís

  reply	other threads:[~2021-10-11 13:44 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-01 17:11 generic/095 failing in ext4 and xfs Luis Henriques
2021-10-01 20:07 ` Theodore Ts'o
2021-10-01 20:46 ` Jens Axboe
2021-10-01 21:59   ` Theodore Ts'o
2021-10-02 10:16     ` Luis Henriques
2021-10-02 14:59       ` Jens Axboe
2021-10-04 10:08         ` Luis Henriques
2021-10-04 10:15           ` Luis Henriques
2021-10-04 12:17             ` Luis Henriques
2021-10-04 16:18               ` Theodore Ts'o
2021-10-06 13:39                 ` Luis Henriques
2021-10-11 10:27         ` [PATCH] fio: make sure io_u->file isn't NULL before using it Luís Henriques
2021-10-11 12:58           ` Jens Axboe
2021-10-11 13:44             ` Luís Henriques [this message]
2021-10-11 15:15               ` Jens Axboe
2021-10-11 15:45                 ` Luís Henriques
2021-10-10  8:31 ` generic/095 failing in ext4 and xfs Zorro Lang
2021-10-11  9:09   ` Luís Henriques
2021-10-11  9:31     ` Ming Lei
2021-10-11 10:16       ` Luís Henriques
2021-10-11 11:13         ` Ming Lei
2021-10-11 13:41           ` Luís Henriques
2021-10-11 12:44         ` Theodore Ts'o
2021-10-11 13:41           ` Luís Henriques

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=YWQ/s44zyPC/ULBi@suse.de \
    --to=lhenriques@suse.de \
    --cc=axboe@kernel.dk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox