summaryrefslogtreecommitdiff
path: root/sys/src/cmd/hjfs/fs1.c
diff options
context:
space:
mode:
authorspew <devnull@localhost>2017-03-27 21:27:45 -0500
committerspew <devnull@localhost>2017-03-27 21:27:45 -0500
commit2e64925b91b4fc19d770dc685c3182121ce6e551 (patch)
tree97df0d3aaa06e87a50a8dfc36353a26be5a38ceb /sys/src/cmd/hjfs/fs1.c
parente02bc28aaf0acd21195914dc1f116651ade2b7b5 (diff)
hjfs: add simple scan check of directory entry blocks
Diffstat (limited to 'sys/src/cmd/hjfs/fs1.c')
-rw-r--r--sys/src/cmd/hjfs/fs1.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/src/cmd/hjfs/fs1.c b/sys/src/cmd/hjfs/fs1.c
index f543f8810..244ad0e23 100644
--- a/sys/src/cmd/hjfs/fs1.c
+++ b/sys/src/cmd/hjfs/fs1.c
@@ -52,13 +52,13 @@ getdent(FLoc *l, Buf *b)
if((d->mode & (DGONE | DALLOC)) == 0){
dprint("hjfs: getdent: file gone, d=%llux, l=%llud/%d %llux, callerpc %#p\n",
d->path, l->blk, l->deind, l->path, getcallerpc(&l));
- werrstr("phase error -- getdent");
+ werrstr("phase error -- directory entry for nonexistent file");
return nil;
}
if(qidcmp(d, l) != 0){
dprint("hjfs: getdent: wrong qid d=%llux != l=%llud/%d %llux, callerpc %#p\n",
d->path, l->blk, l->deind, l->path, getcallerpc(&l));
- werrstr("phase error -- getdent");
+ werrstr("phase error -- qid mismatch");
return nil;
}
return d;
@@ -88,8 +88,10 @@ getfree(Fs *fs, uvlong *r)
}
b = getbuf(d, SUPERBLK, TSUPERBLOCK, 0);
- if(b == nil)
+ if(b == nil) {
+ werrstr("could not find superblock");
return -1;
+ }
e = b->sb.fend;
putbuf(b);