From: Christian Schoenebeck <qemu_oss@crudebyte.com>
To: qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>
Cc: Greg Kurz <groug@kaod.org>, Stefan Hajnoczi <stefanha@redhat.com>
Subject: [PULL 6/7] tests/9p: extend use_dir_after_unlink test with Treaddir
Date: Thu, 06 Feb 2025 17:41:56 +0100 [thread overview]
Message-ID: <6eadd8767ab9422942c3c5e8d70c923e5ee3aa3f.1738860115.git.qemu_oss@crudebyte.com> (raw)
In-Reply-To: <cover.1738860115.git.qemu_oss@crudebyte.com>
Sending a Treaddir request on an unlinked directory should also succeed
if the directory was alread opened before unlink. We just check that no
error occurs and that we get some kind of Treaddir result, but completely
ignore the actual Treaddir result content. In fact, there should be no
system as of to date that would allow a removed directory to have any
content (files, links, devices, subdirectories) and POSIX specifies that
a directory must be empty when trying to remove it from the file system.
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Message-Id: <f1b91e3a33a6502be816d88dfb6b719101b69d41.1736427878.git.qemu_oss@crudebyte.com>
---
tests/qtest/virtio-9p-test.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tests/qtest/virtio-9p-test.c b/tests/qtest/virtio-9p-test.c
index 35c42cd0d7..10243247ab 100644
--- a/tests/qtest/virtio-9p-test.c
+++ b/tests/qtest/virtio-9p-test.c
@@ -772,6 +772,9 @@ static void fs_use_dir_after_unlink(void *obj, void *data,
.client = v9p, .fid = fid_dir, .request_mask = P9_GETATTR_BASIC,
.rgetattr.attr = &attr
});
+ treaddir({
+ .client = v9p, .fid = fid_dir, .offset = 0, .count = P9_MAX_SIZE - 11
+ });
}
static void cleanup_9p_local_driver(void *data)
--
2.30.2
next prev parent reply other threads:[~2025-02-06 16:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-06 16:41 [PULL 0/7] 9p queue 2025-02-06 Christian Schoenebeck
2025-02-06 16:41 ` Christian Schoenebeck [this message]
2025-02-06 16:41 ` [PULL 7/7] MAINTAINERS: Mark me as reviewer only for 9pfs Christian Schoenebeck
2025-02-06 16:41 ` [PULL 1/7] 9pfs: improve v9fs_walk() tracing Christian Schoenebeck
2025-02-06 16:41 ` [PULL 5/7] tests/9p: add use_dir_after_unlink test Christian Schoenebeck
2025-02-06 16:41 ` [PULL 4/7] tests/9p: rename test use_after_unlink -> use_file_after_unlink Christian Schoenebeck
2025-02-06 16:41 ` [PULL 3/7] 9pfs: improve v9fs_open() tracing Christian Schoenebeck
2025-02-06 16:41 ` [PULL 2/7] 9pfs: make multidevs=remap default Christian Schoenebeck
2025-02-06 18:49 ` [PULL 0/7] 9p queue 2025-02-06 Stefan Hajnoczi
2025-02-06 19:31 ` Christian Schoenebeck
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=6eadd8767ab9422942c3c5e8d70c923e5ee3aa3f.1738860115.git.qemu_oss@crudebyte.com \
--to=qemu_oss@crudebyte.com \
--cc=groug@kaod.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@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 NNTP newsgroup(s).