Re: Fixing SB with e2fsck

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 28, 2018 at 05:24:00PM +0200, Jan Kara wrote:
> Hi Ted,
> 
> I was looking into fixing the problem with resize2fs overflowing
> s_inodes_count with e2fsck. The problem there is that e2fsck does not even
> open the filesystem as ext2fs_open2() finds s_inodes_count is corrupted and
> aborts. That seems like a fundamental problem with e2fsck using
> ext2fs_open2() so it is not able to fix corruptions in superblock. Usually
> this can be resolved by resorting to a backup superblock but with this
> resize2fs problem, backup superblocks are buggy in the same way so there's
> no way to fix the filesystem besides binary poking bytes into it (even
> debugfs won't work). So what should we do?
> 
> 1) Just live with the fact that such corruptions are not easily fixable.
> 2) Add a flag to ext2fs_open() to check only a bare minimum in the
> superblock so that e2fsck can start working and fixup the superblock.
> 3) Something else I'm missing.

#2 is the right answer, I think.  What I would do is make sure do
things gradually.  For each class of superblock corruption, (1) add
support to e2fsck to check and fix it, (2) make sure that debugfs
won't crash or triggered to run malicious code, so it can safely use
the EXT2_FLAG_IGNORE_SB_ERRORS flag as well, and (3) exempt that form
of sb corruption from ext2fs_open2() checks if
EXT2_FLAG_IGNORE_SB_ERRORS is set.

						- Ted



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux