From: NeilBrown Date: Sat, 14 Aug 2010 11:05:55 +0000 (+1000) Subject: When cleaner finds a block beyond EOF, ignore whole descriptor. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=7c6e83cc8a4ea178b2b4316229d5d8d2e8c15274;p=LaFS.git When cleaner finds a block beyond EOF, ignore whole descriptor. All other blocks in descriptor must also be beyond EOF, so ignore them all at once. Signed-off-by: NeilBrown --- diff --git a/clean.c b/clean.c index ac59aed..115892e 100644 --- a/clean.c +++ b/clean.c @@ -290,8 +290,11 @@ static void cleaner_parse(struct fs *fs, struct toclean *tc) */ if (LAFSI(ino)->type == 0 || (LAFSI(ino)->type >= TypeBase && - ((loff_t)bnum << ino->i_blkbits) >= i_size_read(ino))) + ((loff_t)bnum << ino->i_blkbits) >= i_size_read(ino))) { + /* skip the whole descriptor */ + bcnt = 1; goto skip; + } itrunc = ((ino->i_generation<<8) | (LAFSI(ino)->trunc_gen & 0xff)) & 0x7fff; if (itrunc != trunc) {