Re: [PATCH] reftable: fix tests being broken by NFS' delete-after-close semantics
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 21, 2024, 17:35 UTC
- Message-ID
- <xmqqsf0j8p48.fsf@gitster.g>
- In-Reply-To
- <8ac5e94a3930cdd2aee9ea86acda3155674b635c.1711035529.git.ps@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 14 quoted lines
> while ((d = readdir(dir))) {
> - if (!strcmp(d->d_name, "..") || !strcmp(d->d_name, "."))
> + /*
> + * Besides skipping over "." and "..", we also need to
> + * skip over other files that have a leading ".". This
> + * is due to behaviour of NFS, which will rename files
> + * to ".nfs*" to emulate delete-on-last-close.
> + *
> + * In any case this should be fine as the reftable
> + * library will never write files with leading dots
> + * anyway.
> + */
> + if (starts_with(d->d_name, "."))
> continue;Sounds good. We should count what we positively consider what we wrote, not random cruft somebody else might have dropped in the directory, and this is a good first thing to do.
Will queue. Thanks.