FS/XFS testing framework
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: NeilBrown <neil@brown.name>
Cc: fstests@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Chuck Lever <cel@kernel.org>
Subject: Re: [PATCH] fstests: generic: Add test of seek in directories
Date: Fri, 28 Aug 2026 05:13:26 +0100	[thread overview]
Message-ID: <apEK5uirjyLZUfmA@casper.infradead.org> (raw)
In-Reply-To: <20260827234743.2389778-2-neilb@ownmail.net>

On Fri, Aug 28, 2026 at 09:36:10AM +1000, NeilBrown wrote:
> Add a test for consistency of readdir (getdents64) results.
> The expectation is that name which exist before a readdir starts, and
> still exist when the readdir completes, and which have not been removed
> or renamed away and re-created, should appear exactly once.
> Also if the fd on the file is closed in the middle of a readdir and
> re-opened with a seek to some offset previously reported, the same
> sequence should be reported as if the file was kept open with no
> seeking.  This last is important for nfsd.

I'm not sure it's required by POSIX:

	The behavior is unspecified if lseek() is used to set the file
	offset to a value other than zero or a value returned by a
	previous call to lseek() on the same open file description."

https://pubs.opengroup.org/onlinepubs/9799919799/functions/posix_getdents.html

We can of course require stronger semantics from Linux filesystems
than POSIX requires,  We should discuss the benefits & costs of doing so
(and I have no idea what the costs to btrfs or tmpfs might be).

  reply	other threads:[~2026-08-28  4:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-27 23:36 fstests: Verify behaviour of "seek" in a directory NeilBrown
2026-08-27 23:36 ` [PATCH] fstests: generic: Add test of seek in directories NeilBrown
2026-08-28  4:13   ` Matthew Wilcox [this message]
2026-08-28 11:12     ` NeilBrown
2026-08-28 14:55       ` Theodore Tso
2026-08-30 22:22         ` NeilBrown
2026-08-31  1:37           ` Theodore Tso
2026-08-31 13:16       ` Christoph Hellwig
2026-09-01  1:05         ` NeilBrown
2026-09-01  9:18           ` Christoph Hellwig
2026-08-30 23:13   ` Chuck Lever
2026-08-31 12:59   ` Christoph Hellwig
2026-08-31 22:47     ` NeilBrown
2026-09-01  9:09       ` Christoph Hellwig

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=apEK5uirjyLZUfmA@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=cel@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=neil@brown.name \
    /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