Thread (1 message) 1 message, 1 author, 2024-03-21

Re: [PATCH] reftable: fix tests being broken by NFS' delete-after-close semantics

From: Junio C Hamano <hidden>
Date: 2024-03-21 17:35:24
Also in: linux-nfs

Patrick Steinhardt [off-list ref] writes:
 	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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help