ref: 869a9be7c874109f73eb57f405b94e3e86242039
parent: 760708dc3894c802b7a0a01ed23386bb19a519d7
author: 9ferno <[email protected]>
date: Wed Dec 7 02:51:29 EST 2022
bug in remove when the file size is exactly Ddatasize
--- a/9p.c
+++ b/9p.c
@@ -1316,7 +1316,7 @@
if(offset >= filesize)
goto readend;
- if(filesize < Ddatasize){
+ if(filesize <= Ddatasize){
n = min(filesize-offset, rbufsize);
memcpy(rbuf, d->buf+offset, n);
sent = n;
--- a/dentry.c
+++ b/dentry.c
@@ -323,7 +323,7 @@
}
putbuf(dbuf, 1);
- if(size < Ddatasize)
+ if(size <= Ddatasize)
return;
lastreli = d.size/Maxdatablocksize;
--- a/updatefrees.c
+++ b/updatefrees.c
@@ -94,7 +94,7 @@
print("changed size: %llud to %d\n", d->size, nfreesize);
memset(d->buf, 0, Ddatasize);
d->size = nfreesize;
- if(nfreesize < Ddatasize){
+ if(nfreesize <= Ddatasize){
strncpy(d->buf, (s8*)f->buf, nfreesize);
devwrite(Bdfrees, buf, Metadataunits);
}else{