All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: virtio-fs-list <virtio-fs@redhat.com>
Subject: Re: [Virtio-fs] xfstest generic/503 hangs
Date: Mon, 23 Mar 2020 18:43:09 +0000	[thread overview]
Message-ID: <20200323184309.GE3017@work-vm> (raw)
In-Reply-To: <cb5bc383-a669-ebaa-3919-a5f860e10a52@redhat.com>

* Max Reitz (mreitz@redhat.com) wrote:
> Hi,
> 
> I have this bug report here:
> https://bugzilla.redhat.com/show_bug.cgi?id=1813885
> 
> And I’m afraid I’m not really making progress on debugging it, so I was
> wondering whether any of you might have some insights.
> 
> The problem is that the generic/503 xfstest hangs on virtio-fs.  Now, I
> don’t know how the reporter got that test to run in the first place,
> because for me, it requires fcollapse and fzero, which as far as I can
> tell are currently not supported for virtio-fs.
> 
> So I first had to disable those requirements, and then let the helper
> program (src/t_mmap_collision.c) not test those operations.
> 
> Then, the test hangs.  What I could find out so far is that the hang
> occurs in src/t_mmap_collision.c’s truncate_down_fn() (run through
> run_test(&truncate_down_fn), namely in one of the pread()s.  I can also
> see that some of the pread()s before fail with EFAULT.
> 
> A bit more context: t_mmap_collision.c opens a test file twice (I think
> the idea is that you open it once on an FS with DAX, and once without,
> but AFAIU it should work either way).  For the relevant test, it mmap()s
> the DAX FD, truncates it, then fallocates it to increase the size again.
>  Then it reads from the non-DAX FD.

Can you just confirm where the DAX is happening here?  As I read that bz
entry it's using the qemu which doesn't have DAX code yet.

Dave

> It does all of that in two threads simultaneously for a second.
> 
> The EFAULT seems to come from the guest kernel.  I don’t see virtiofsd
> returning an error anywhere.  I don’t know where it comes from exactly,
> only that when I replace all occurrences of “EFAULT” by e.g. “EBADSLT”
> in mm/, the test crashes instead of hanging, so I take that to mean that
> the error comes from something in mm/ (which I suppose isn’t too
> unexpected).
> 
> The test passes if running the test function in a single thread instead
> of two, or if you use a separate TEST_DEV and SCRATCH_DEV – but in the
> latter case, you really have two separate files, so the test becomes
> rather moot (AFAIU).
> 
> The fact that truncate_down_fn() uses fallocate() seems irrelevant.
> When you replace it by ftruncate() (i.e. the dax_fd is just first
> truncated to 0, and then truncated back to @file_size), the test fails
> in the same way.  So maybe there is some interaction between the
> ftruncate() and a concurrent pread()?  But where does the EFAULT come from?
> 
> Does anyone have any spontaneous ideas? :/
> 
> 
> In any case, thanks already for reading this,
> 
> Max
> 
> 
> (I suppose my plan now is that instead of debugging the kernel further,
> I should come up with a simpler reproducer, to see whether the problem
> is really just a concurrent ftruncate() + pread() on two FDs that point
> to the same file.)
> 




> _______________________________________________
> Virtio-fs mailing list
> Virtio-fs@redhat.com
> https://www.redhat.com/mailman/listinfo/virtio-fs

--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK


  parent reply	other threads:[~2020-03-23 18:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-23 18:18 [Virtio-fs] xfstest generic/503 hangs Max Reitz
2020-03-23 18:40 ` Liu Bo
2020-03-23 19:12   ` Liu Bo
2020-03-24 17:32     ` Max Reitz
2020-03-23 18:43 ` Dr. David Alan Gilbert [this message]
2020-03-24 17:30   ` Max Reitz
2020-03-24 19:52     ` Dr. David Alan Gilbert
2020-03-25  9:49       ` Max Reitz

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=20200323184309.GE3017@work-vm \
    --to=dgilbert@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=virtio-fs@redhat.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 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.