All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Martin Doucha <mdoucha@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] Add test for file truncation over NFS
Date: Tue, 13 Feb 2024 17:48:47 +0100	[thread overview]
Message-ID: <20240213164847.GA699750@pevik> (raw)
In-Reply-To: <20240213140233.14445-1-mdoucha@suse.cz>

Hi Martin,

Merged, thank you!

> Some older kernels have a bug in NFS where the client caches that
> a file does not exist after unsuccessful access to it and then
> does not pass O_TRUNC flag to the server even though the file may
> have been created by another client in the mean time. This may result
> in new data being merged with old file contents instead of replacing
> them.
...

> +++ b/runtest/net.nfs
> @@ -83,6 +83,17 @@ nfs08_v40_ip6t nfs08.sh -6 -v 4 -t tcp
>  nfs08_v41_ip6t nfs08.sh -6 -v 4.1 -t tcp
>  nfs08_v42_ip6t nfs08.sh -6 -v 4.2 -t tcp

> +nfs09_v30_ip4u nfs09.sh -v 3 -t udp
> +nfs09_v30_ip4t nfs09.sh -v 3 -t tcp

For a record, this is the test which fails. And NFSv3 is affected on all
kernels, including latest stable 6.7.4 and 6.8.0-rc1 (both openSUSE packages).

> +nfs09_v40_ip4t nfs09.sh -v 4 -t tcp
> +nfs09_v41_ip4t nfs09.sh -v 4.1 -t tcp
> +nfs09_v42_ip4t nfs09.sh -v 4.2 -t tcp
> +nfs09_v30_ip6u nfs09.sh -6 -v 3 -t udp
> +nfs09_v30_ip6t nfs09.sh -6 -v 3 -t tcp
> +nfs09_v40_ip6t nfs09.sh -6 -v 4 -t tcp
> +nfs09_v41_ip6t nfs09.sh -6 -v 4.1 -t tcp
> +nfs09_v42_ip6t nfs09.sh -6 -v 4.2 -t tcp
...
> +++ b/testcases/network/nfs/nfs_stress/nfs09.sh
...
> +do_test()
> +{
> +	local local_file="testfile"
> +	local remote_file="$(nfs_get_remote_path)/$local_file"
> +	local testmsg='File truncated'
> +	local data
> +
> +	EXPECT_FAIL "ls -l '$local_file'"
> +	tst_rhost_run -c "echo -n 'File rewritten not' >'$remote_file'"
> +	echo -n "$testmsg" >"$local_file"
echo is considered unportable (printf is preferred), but "echo -n" should be
hopefully safe nowadays.

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

      reply	other threads:[~2024-02-13 16:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-13 14:02 [LTP] [PATCH] Add test for file truncation over NFS Martin Doucha
2024-02-13 16:48 ` Petr Vorel [this message]

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=20240213164847.GA699750@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=mdoucha@suse.cz \
    /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.