summaryrefslogtreecommitdiff
path: root/fs.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs.c')
-rw-r--r--fs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs.c b/fs.c
index a414b65..a76788b 100644
--- a/fs.c
+++ b/fs.c
@@ -437,13 +437,13 @@ writei(struct inode *ip, char *src, uint off, uint n)
if(off > ip->size || off + n < off)
return -1;
if(off + n > MAXFILE*BSIZE)
- n = MAXFILE*BSIZE - off;
+ return -1;
for(tot=0; tot<n; tot+=m, off+=m, src+=m){
bp = bread(ip->dev, bmap(ip, off/BSIZE));
m = min(n - tot, BSIZE - off%BSIZE);
memmove(bp->data + off%BSIZE, src, m);
- bwrite(bp);
+ log_write(bp);
brelse(bp);
}