diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/fs.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/fs.c b/kernel/fs.c index ec68cd7..848b2c9 100644 --- a/kernel/fs.c +++ b/kernel/fs.c @@ -468,6 +468,7 @@ readi(struct inode *ip, int user_dst, uint64 dst, uint off, uint n) m = min(n - tot, BSIZE - off%BSIZE); if(either_copyout(user_dst, dst, bp->data + (off % BSIZE), m) == -1) { brelse(bp); + tot = -1; break; } brelse(bp); @@ -495,6 +496,7 @@ writei(struct inode *ip, int user_src, uint64 src, uint off, uint n) m = min(n - tot, BSIZE - off%BSIZE); if(either_copyin(bp->data + (off % BSIZE), user_src, src, m) == -1) { brelse(bp); + n = -1; break; } log_write(bp); |