From: Zorro Lang <zlang@redhat.com>
To: fstests@vger.kernel.org
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 1/4] src/t_rename_overwrite: fsync to flush the rename operation result
Date: Wed, 20 Apr 2022 16:36:50 +0800 [thread overview]
Message-ID: <20220420083653.1031631-2-zlang@redhat.com> (raw)
In-Reply-To: <20220420083653.1031631-1-zlang@redhat.com>
The generic/035 fails on glusterfs due to glusterfs (or others like
it), the file state can't be updated in time in client side, there's
time delay. So call fsync to get the right file state after rename.
Signed-off-by: Zorro Lang <zlang@redhat.com>
---
src/t_rename_overwrite.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/t_rename_overwrite.c b/src/t_rename_overwrite.c
index c5cdd1db..8dcf8d46 100644
--- a/src/t_rename_overwrite.c
+++ b/src/t_rename_overwrite.c
@@ -2,6 +2,7 @@
#include <fcntl.h>
#include <err.h>
#include <sys/stat.h>
+#include <unistd.h>
int main(int argc, char *argv[])
{
@@ -25,6 +26,7 @@ int main(int argc, char *argv[])
res = rename(path1, path2);
if (res == -1)
err(1, "rename(\"%s\", \"%s\")", path1, path2);
+ fsync(fd);
res = fstat(fd, &stbuf);
if (res == -1)
--
2.31.1
next prev parent reply other threads:[~2022-04-20 8:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-20 8:36 [PATCH 0/4] several long time unmerged patches from zlang Zorro Lang
2022-04-20 8:36 ` Zorro Lang [this message]
2022-04-20 17:13 ` [PATCH 1/4] src/t_rename_overwrite: fsync to flush the rename operation result Darrick J. Wong
2022-04-20 8:36 ` [PATCH 2/4] fstests: avoid dedupe testing blocked on large fs long time Zorro Lang
2022-04-20 8:36 ` [PATCH 3/4] generic: test data corruption when blocksize < pagesize for mmaped data Zorro Lang
2022-04-20 17:25 ` Darrick J. Wong
2022-04-20 8:36 ` [PATCH 4/4] fstests: test xfs swapext log replay Zorro Lang
2022-04-20 18:08 ` Darrick J. Wong
2022-04-20 22:06 ` Darrick J. Wong
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=20220420083653.1031631-2-zlang@redhat.com \
--to=zlang@redhat.com \
--cc=fstests@vger.kernel.org \
--cc=linux-xfs@vger.kernel.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