Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,17 @@ static int __file_lookup(struct inode *dir,
*fi = _fi;
return 0;
}
_fi += dblock->files[_fi].nr_blk;
if (!dblock->files[_fi].nr_blk) {
/*
this means the _ei and _bi we're looking for is looking at
an empty block. we have to advance nontheless, but nr_blk
would just add 0 to fi, causing endless loop. so we skip
this entry by 1, just in case.
*/
_fi += 1;
} else {
_fi += dblock->files[_fi].nr_blk;
}
}
RELEASE_BUFFER_HEAD(*ret_bi_bh);
}
Expand Down
Loading