shithub: front

Download patch

ref: c409b9127d903a9dfe21f64385ed6a914992e501
parent: 821e6690d37d21ceabae3353dd0b471c54cfc856
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Jul 28 20:37:33 EDT 2024

gefs: correct in-memory directory length for DMAPPEND files (thanks cinap)

when appending to a directory, the copy of the offset in the dent was
set to the offset that the write was supposed to happen at -- however,
for DMAPPEND files the offset is always at the end of the file. Until
the file was closed, stat would show the wrong directory info.

--- a/sys/src/cmd/gefs/fs.c
+++ b/sys/src/cmd/gefs/fs.c
@@ -2218,7 +2218,7 @@
 		sbuf[0] |= Owsize;
 		PACK64(p, o);
 		p += 8;
-		f->dent->length = m->offset+m->count;
+		f->dent->length = o;
 	}
 	sbuf[0] |= Owmtime;
 	f->dent->mtime = nsec();
--