linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Andreas Dilger <adilger@dilger.ca>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH 2/2] debugfs, e2fsck: fix s_desc_size handling
Date: Mon, 23 Dec 2013 16:07:50 -0500	[thread overview]
Message-ID: <20131223210749.GC11299@thunk.org> (raw)
In-Reply-To: <1387268344-8320-2-git-send-email-adilger@dilger.ca>

On Tue, Dec 17, 2013 at 01:19:04AM -0700, Andreas Dilger wrote:
> The s_desc_size in the superblock specifies the group descriptor
> size in bytes, but in various places the EXT4_FEATURE_INCOMPAT_64BIT
> flag implies that the descriptor size is EXT2_MIN_DESC_SIZE_64BIT
> (64 bytes) instead of checking the actual size.  In other places,
> the s_desc_size field is used without checking for INCOMPAT_64BIT.
> 
> In the case of ext2fs_group_desc() the s_desc_size was being ignored,
> and assumed to be sizeof(struct ext4_group_desc), which would result
> in garbage for any but the first group descriptor.  Similarly, in
> ext2fs_group_desc_csum() and print_csum() they assumed that the
> maximum group descriptor size was sizeof(struct ext4_group_desc).
> Fix these functions to use the actual superblock s_desc_size if
> INCOMPAT_64BIT.
> 
> Conversely, in ext2fs_swap_group_desc2() s_desc_size was used
> without checking for INCOMPAT_64BIT being set.
> 
> The e2fsprogs behaviour is different than that of the kernel,
> which always checks INCOMPAT_64BIT, and only uses s_desc_size to
> determine the offset of group descriptors and what range of bytes
> to checksum.
> 
> Allow specifying the s_desc_size field at mke2fs time with the
> "-E desc_size=NNN" option.  Allow a power-of-two s_desc_size
> value up to s_blocksize if INCOMPAT_64BIT is specified.  This
> is not expected to be used by regular users at this time, so it
> is not currently documented in the mke2fs usage or man page.
> 
> Add m_desc_size_128, f_desc_size_128, and f_desc_bad test cases to
> verify mke2fs and e2fsck handling of larger group descriptor sizes.
> 
> Signed-off-by: Andreas Dilger <adilger@dilger.ca>

Thanks, applied.

						- Ted

  reply	other threads:[~2013-12-23 21:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-17  8:19 [PATCH 1/2] e2fsck: verify s_desc_size is power-of-two value Andreas Dilger
2013-12-17  8:19 ` [PATCH 2/2] debugfs, e2fsck: fix s_desc_size handling Andreas Dilger
2013-12-23 21:07   ` Theodore Ts'o [this message]
2013-12-23 21:07 ` [PATCH 1/2] e2fsck: verify s_desc_size is power-of-two value Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131223210749.GC11299@thunk.org \
    --to=tytso@mit.edu \
    --cc=adilger@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).