shithub: gefs

Download patch

ref: a57ce705ce68b24a63273caafb7d18d49d866f44
parent: 9878fd219b0b214f6347ded88bc8936d62233227
author: Ori Bernstein <ori@eigenstate.org>
date: Sun May 14 11:14:45 EDT 2023

fs: add assert

--- a/dat.h
+++ b/dat.h
@@ -570,6 +570,7 @@
 
 struct Conn {
 	Conn	*next;
+	QLock	wrlk;
 	int	rfd;
 	int	wfd;
 	int	iounit;
--- a/fs.c
+++ b/fs.c
@@ -200,6 +200,7 @@
 
 	r->tag = m->tag;
 	dprint("→ %F\n", r);
+	assert(m->type+1 == r->type || r->type == Rerror || r->type == Rflush);
 	if((n = convS2M(r, buf, sizeof(buf))) == 0)
 		abort();
 	w = write(m->conn->wfd, buf, n);