From: virtiofs-bot@sinrega.org
To: virtio-fs@redhat.com
Subject: [Virtio-fs] [virtiofsd] Issue opened: Unexpected behavior observed when using mmap on virtiofs backed paths
Date: Thu, 10 Nov 2022 14:51:55 +0000 (UTC) [thread overview]
Message-ID: <30170.122111009514800261@us-mta-459.us.mimecast.lan> (raw)
When using python and writing to a mmap file, I am seeing with cache mode auto and always that the file is increasing in size each time I write to it. This is seen with virtiofsd C version ( 6.1.0 ) as well as RS version (1.3.0), and can be reproduced using QEMU (6.2) as well as Cloud Hypervisor (v0.26). When switching to a different vhost-user-fs backend (nydusd), we can no longer reproduce the failure.
The following python script will show the failure behavior if run on a virtiofs backed path:
```
import mmap
import struct
l = 1024
f = open("./test.db", "a+b")
f.truncate(l)
m = mmap.mmap(f.fileno(), 1024, access=mmap.ACCESS_WRITE)
m[0:4] = b"0000"
m.flush()
m.size()
m[0:4] = b"0000"
m.flush()
m.size()
```
See https://github.com/kata-containers/kata-containers/issues/5634 for more details on reproduction.
---
https://gitlab.com/virtio-fs/virtiofsd/-/issues/67
reply other threads:[~2022-11-10 14:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=30170.122111009514800261@us-mta-459.us.mimecast.lan \
--to=virtiofs-bot@sinrega.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).