From: Mark Hatle <mark.hatle@kernel.crashing.org>
To: yocto-patches@lists.yoctoproject.org
Subject: [pseudo][pseudo-1.9]PATCH 08/10] test-parallel-ops: Add a parallel create/rename/link/chmod test
Date: Wed, 11 Nov 2026 10:15:10 -0600 [thread overview]
Message-ID: <1794413712-18072-9-git-send-email-mark.hatle@kernel.crashing.org> (raw)
In-Reply-To: <1794413712-18072-1-git-send-email-mark.hatle@kernel.crashing.org>
From: Mark Hatle <mark.hatle@amd.com>
Four workers repeatedly create, rename onto, chmod, chown, symlink,
hard link and remove the same names in one directory. The test fails
if any of the operations fail, or if the server logged an inode or path
mismatch while it ran.
Without the path lock in the create, metadata and open wrappers, the
server reports mismatches and occasionally aborts a client.
AI-Generated: Uses GitHub Copilot
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
(cherry picked from commit 7f582310cb7eb67da9b20ceb3082331518f6d4fb)
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
---
test/test-parallel-ops.sh | 53 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
create mode 100755 test/test-parallel-ops.sh
diff --git a/test/test-parallel-ops.sh b/test/test-parallel-ops.sh
new file mode 100755
index 0000000..2fccd30
--- /dev/null
+++ b/test/test-parallel-ops.sh
@@ -0,0 +1,53 @@
+#!/bin/bash
+#
+# SPDX-License-Identifier: LGPL-2.1-only
+#
+# Several clients create, rename, link, chmod and remove the same names in
+# one directory at once. pseudo must not let one client's operation land in
+# the middle of another client's change to the same name, or the server
+# finds the database out of step with the filesystem. It then logs an
+# "inode mismatch" or "path mismatch" error, and may abort a client.
+#
+# The temporary tree has to live below $PWD so that pseudo tracks it.
+
+tmpdir="$(mktemp -d -p "$PWD" parallel_ops_XXXXXX)"
+trap "rm -rf '$tmpdir'" EXIT TERM INT
+
+log="${PSEUDO_LOCALSTATEDIR:-$PWD/var/pseudo}/pseudo.log"
+mismatches() {
+ grep -c "mismatch" "$log" 2>/dev/null || true
+}
+before=$(mismatches)
+
+cd "$tmpdir" || exit 1
+: > target
+
+worker() {
+ for i in $(seq 50); do
+ echo "$1 $i" > "tmp.$1" || echo "FAILED: create tmp.$1" >> failed
+ mv -f "tmp.$1" target || echo "FAILED: mv tmp.$1 target" >> failed
+ chmod 640 target 2>/dev/null
+ chown 0:0 target 2>/dev/null
+ ln -sf target lnk || echo "FAILED: ln -sf target lnk" >> failed
+ mkdir dir 2>/dev/null; rmdir dir 2>/dev/null
+ mkfifo "f.$1" && mv -f "f.$1" fifo || echo "FAILED: mkfifo/mv f.$1" >> failed
+ ln -f target "hard.$1" 2>/dev/null && rm -f "hard.$1"
+ done
+}
+
+for w in 1 2 3 4; do
+ worker $w &
+done
+wait
+
+rc=0
+if [ -e failed ]; then
+ sort failed | uniq -c
+ rc=1
+fi
+after=$(mismatches)
+if [ "${after:-0}" -ne "${before:-0}" ]; then
+ echo "FAILED: $((after - before)) mismatch error(s) in $log"
+ rc=1
+fi
+exit $rc
--
1.8.3.1
next prev parent reply other threads:[~2026-11-11 16:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 16:15 [pseudo][pseudo-1.9]PATCH 00/10] Backports from master to 1.9 branch Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 01/10] test: Skip open_tree tests when the function or syscall is unavailable Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 02/10] makewrappers: Don't generate unused _int paths with noignore_path Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 03/10] ports/linux: Don't require <linux/mount.h> Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 04/10] configure: Require GCC 5 or later Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 05/10] pseudo_client: serialize path changes across clients Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 06/10] ports: hold the path lock in create and metadata wrappers Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 07/10] ports: check created files under the path lock before recording them Mark Hatle
2026-11-11 16:15 ` Mark Hatle [this message]
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 09/10] README.security: Add information specific to file/process security Mark Hatle
2026-11-11 16:15 ` [pseudo][pseudo-1.9]PATCH 10/10] AGENTS.md: Add to assist future developers Mark Hatle
2026-11-12 11:46 ` [yocto-patches] [pseudo][pseudo-1.9]PATCH 00/10] Backports from master to 1.9 branch Yoann Congal
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=1794413712-18072-9-git-send-email-mark.hatle@kernel.crashing.org \
--to=mark.hatle@kernel.crashing.org \
--cc=yocto-patches@lists.yoctoproject.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 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.