All of lore.kernel.org
 help / color / mirror / Atom feed
* Broken e2fsck i_blocks repair
@ 2010-09-01 23:01 Justin Maggard
  2010-09-01 23:49 ` Andreas Dilger
  2010-09-25 12:24 ` Ted Ts'o
  0 siblings, 2 replies; 4+ messages in thread
From: Justin Maggard @ 2010-09-01 23:01 UTC (permalink / raw)
  To: ext4 development

I've mentioned this before on here, but I never verified whether or
not it was actually broken.  I have done so today.  I manually
modified the block count of a 3TB file using debugfs, then ran e2fsck
on it.  e2fsck claimed to repair it, but would throw an error on every
subsequent e2fsck run for the same issue.  The reason is
inode->osd2.linux2.l_i_blocks_hi is always set to 0 if e2fsck is told
to fix it.  This is an issue in both stable 1.41.12, and in master.
This patch fixes it for me, but is there anything else that needs to
get checked here?

diff -urp e2fsprogs-1.41.12/e2fsck/pass1.c e2fsprogs-1.41.12-jm/e2fsck/pass1.c
--- e2fsprogs-1.41.12/e2fsck/pass1.c	2010-05-14 14:51:21.000000000 -0700
+++ e2fsprogs-1.41.12-jm/e2fsck/pass1.c	2010-09-01 15:54:42.000000000 -0700
@@ -2044,7 +2044,7 @@ static void check_blocks(e2fsck_t ctx, s
 		pctx->num = pb.num_blocks;
 		if (fix_problem(ctx, PR_1_BAD_I_BLOCKS, pctx)) {
 			inode->i_blocks = pb.num_blocks;
-			inode->osd2.linux2.l_i_blocks_hi = 0;
+			inode->osd2.linux2.l_i_blocks_hi = (pb.num_blocks >> 32);
 			dirty_inode++;
 		}
 		pctx->num = 0;

-Justin

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-09-25 12:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-01 23:01 Broken e2fsck i_blocks repair Justin Maggard
2010-09-01 23:49 ` Andreas Dilger
2010-09-02  0:08   ` Eric Sandeen
2010-09-25 12:24 ` Ted Ts'o

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.