qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christian Schoenebeck <qemu_oss@crudebyte.com>
To: qemu-devel@nongnu.org
Cc: Greg Kurz <groug@kaod.org>
Subject: [PATCH 3/3] tests/9p: extend use_dir_after_unlink test with Treaddir
Date: Thu, 9 Jan 2025 13:59:56 +0100	[thread overview]
Message-ID: <f1b91e3a33a6502be816d88dfb6b719101b69d41.1736427878.git.qemu_oss@crudebyte.com> (raw)
In-Reply-To: <cover.1736427878.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>
---
 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.39.5



  parent reply	other threads:[~2025-01-09 13:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-09 13:04 [PATCH 0/3] tests/9p: add use-dir-after-unlink test Christian Schoenebeck
2025-01-09 12:59 ` [PATCH 1/3] tests/9p: rename test use_after_unlink -> use_file_after_unlink Christian Schoenebeck
2025-01-09 12:59 ` [PATCH 2/3] tests/9p: add use_dir_after_unlink test Christian Schoenebeck
2025-01-09 12:59 ` Christian Schoenebeck [this message]
2025-01-30 14:27 ` [PATCH 0/3] tests/9p: add use-dir-after-unlink test 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=f1b91e3a33a6502be816d88dfb6b719101b69d41.1736427878.git.qemu_oss@crudebyte.com \
    --to=qemu_oss@crudebyte.com \
    --cc=groug@kaod.org \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).