]> git.neil.brown.name Git - LaFS.git/commitdiff
When cleaner finds a block beyond EOF, ignore whole descriptor.
authorNeilBrown <neilb@suse.de>
Sat, 14 Aug 2010 11:05:55 +0000 (21:05 +1000)
committerNeilBrown <neilb@suse.de>
Sat, 14 Aug 2010 11:05:55 +0000 (21:05 +1000)
All other blocks in descriptor must also be beyond EOF,
so ignore them all at once.

Signed-off-by: NeilBrown <neilb@suse.de>
clean.c

diff --git a/clean.c b/clean.c
index ac59aed7159ead38337a08223370f053a962adb8..115892eabeabff64f8c8db473e88a486971783ed 100644 (file)
--- 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) {