linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* e2fsck aborts when invalid indirect block is encountered
@ 2011-09-01  6:34 Chen Huan
  2011-09-01  8:17 ` Andreas Dilger
  2011-09-01 17:00 ` Ted Ts'o
  0 siblings, 2 replies; 4+ messages in thread
From: Chen Huan @ 2011-09-01  6:34 UTC (permalink / raw)
  To: linux-ext4

Hi, All.

During a recent read-only checking of an corrupted ext3 file system,
I found a strange behaviour of e2fsck: when an inode has an invalid
indirect block number, e2fsck aborts with the following message:

    e2fsck 1.39 (29-May-2006)
    Pass 1: Checking inodes, blocks, and sizes
    Inode 12 has illegal block(s).  Clear? no

    Illegal block #-1 (4294967295) in inode 12.  IGNORED.
    Error while iterating over blocks in inode 12: Illegal indirect block found
    e2fsck: aborted

You can reproduce it with this code snippet:

    #!/bin/sh

    dev=/dev/sde
    mnt=/mnt

    mkfs.ext3 -F $dev
    mount $dev $mnt
    dd if=/dev/zero of=$mnt/file bs=1M count=1
    umount $dev
    debugfs -w -R 'sif file block[IND] 0xFFFFFFFF' $dev
    e2fsck -f -n $dev

Doing a fixing without -n option can safely delete this bad blocknum.

My question is: Is this behaviour a bug or intended?

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

* Re: e2fsck aborts when invalid indirect block is encountered
  2011-09-01  6:34 e2fsck aborts when invalid indirect block is encountered Chen Huan
@ 2011-09-01  8:17 ` Andreas Dilger
  2011-09-01  8:52   ` Chen Huan
  2011-09-01 17:00 ` Ted Ts'o
  1 sibling, 1 reply; 4+ messages in thread
From: Andreas Dilger @ 2011-09-01  8:17 UTC (permalink / raw)
  To: Chen Huan; +Cc: linux-ext4

On 2011-09-01, at 12:34 AM, Chen Huan wrote:
> During a recent read-only checking of an corrupted ext3 file system,
> I found a strange behaviour of e2fsck: when an inode has an invalid
> indirect block number, e2fsck aborts with the following message:
> 
>    e2fsck 1.39 (29-May-2006)

Please retest with a new version of e2fsprogs.  The current release
version is 1.41.14, and the work-in-progress for version 1.42 is
available via Git.

>    Pass 1: Checking inodes, blocks, and sizes
>    Inode 12 has illegal block(s).  Clear? no
> 
>    Illegal block #-1 (4294967295) in inode 12.  IGNORED.
>    Error while iterating over blocks in inode 12: Illegal indirect block found
>    e2fsck: aborted
> 
> You can reproduce it with this code snippet:
> 
>    #!/bin/sh
> 
>    dev=/dev/sde
>    mnt=/mnt
> 
>    mkfs.ext3 -F $dev
>    mount $dev $mnt
>    dd if=/dev/zero of=$mnt/file bs=1M count=1
>    umount $dev
>    debugfs -w -R 'sif file block[IND] 0xFFFFFFFF' $dev
>    e2fsck -f -n $dev
> 
> Doing a fixing without -n option can safely delete this bad blocknum.
> 
> My question is: Is this behaviour a bug or intended?
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


Cheers, Andreas






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

* Re: e2fsck aborts when invalid indirect block is encountered
  2011-09-01  8:17 ` Andreas Dilger
@ 2011-09-01  8:52   ` Chen Huan
  0 siblings, 0 replies; 4+ messages in thread
From: Chen Huan @ 2011-09-01  8:52 UTC (permalink / raw)
  To: Andreas Dilger; +Cc: linux-ext4

* Andreas Dilger <adilger@dilger.ca> [2011-09-01 02:17:14 -0600]:

> On 2011-09-01, at 12:34 AM, Chen Huan wrote:
> > During a recent read-only checking of an corrupted ext3 file system,
> > I found a strange behaviour of e2fsck: when an inode has an invalid
> > indirect block number, e2fsck aborts with the following message:
> > 
> >    e2fsck 1.39 (29-May-2006)
> 
> Please retest with a new version of e2fsprogs.  The current release
> version is 1.41.14, and the work-in-progress for version 1.42 is
> available via Git.

The problem remains in e2fsck 1.42-WIP (02-Jul-2011)

> 
> >    Pass 1: Checking inodes, blocks, and sizes
> >    Inode 12 has illegal block(s).  Clear? no
> > 
> >    Illegal block #-1 (4294967295) in inode 12.  IGNORED.
> >    Error while iterating over blocks in inode 12: Illegal indirect block found
> >    e2fsck: aborted
> > 
> > You can reproduce it with this code snippet:
> > 
> >    #!/bin/sh
> > 
> >    dev=/dev/sde
> >    mnt=/mnt
> > 
> >    mkfs.ext3 -F $dev
> >    mount $dev $mnt
> >    dd if=/dev/zero of=$mnt/file bs=1M count=1
> >    umount $dev
> >    debugfs -w -R 'sif file block[IND] 0xFFFFFFFF' $dev
> >    e2fsck -f -n $dev
> > 
> > Doing a fixing without -n option can safely delete this bad blocknum.
> > 
> > My question is: Is this behaviour a bug or intended?
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> Cheers, Andreas
> 
> 
> 
> 
> 

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

* Re: e2fsck aborts when invalid indirect block is encountered
  2011-09-01  6:34 e2fsck aborts when invalid indirect block is encountered Chen Huan
  2011-09-01  8:17 ` Andreas Dilger
@ 2011-09-01 17:00 ` Ted Ts'o
  1 sibling, 0 replies; 4+ messages in thread
From: Ted Ts'o @ 2011-09-01 17:00 UTC (permalink / raw)
  To: linux-ext4

On Thu, Sep 01, 2011 at 02:34:10PM +0800, Chen Huan wrote:
> Hi, All.
> 
> During a recent read-only checking of an corrupted ext3 file system,
> I found a strange behaviour of e2fsck: when an inode has an invalid
> indirect block number, e2fsck aborts with the following message:
> 
>     e2fsck 1.39 (29-May-2006)
>     Pass 1: Checking inodes, blocks, and sizes
>     Inode 12 has illegal block(s).  Clear? no
> 
>     Illegal block #-1 (4294967295) in inode 12.  IGNORED.
>     Error while iterating over blocks in inode 12: Illegal indirect block found
>     e2fsck: aborted

> My question is: Is this behaviour a bug or intended?

This is deliberate.  There are two reasons for this:

(1) e2fsck -n is currently defined as being equivalent to (a) opening
the file system read-only, and (b) answering 'no' to all questions
asked by e2fsck.

(2) In the case where you *aren't* doing an e2fsck -n, there are
certain situations where not correcting an error means (a) that its
dangerous to try to fix anything afterwards, and that (b) many of the
diagnostics issued by e2fsck can not be relied upon.

We could change things so that e2fsck doesn't abort in the case where
-n is specified, which would avoid the problem 2a, but it breaks the
definition of 1b.  It also doesn't solve the problem listed in 2b.
Still, if it's really annoying it's something I could consider
changing.  Let me sleep on it.

	      	      	   	   - Ted

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

end of thread, other threads:[~2011-09-01 17:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-01  6:34 e2fsck aborts when invalid indirect block is encountered Chen Huan
2011-09-01  8:17 ` Andreas Dilger
2011-09-01  8:52   ` Chen Huan
2011-09-01 17:00 ` Ted Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).