Bug 117421 - e2fsprogs: mke2fs ignores sparse_super2 when also using extent or 64bit
Summary: e2fsprogs: mke2fs ignores sparse_super2 when also using extent or 64bit
Status: RESOLVED CODE_FIX
Alias: None
Product: File System
Classification: Unclassified
Component: ext4 (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: fs_ext4@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-30 11:08 UTC by Kelly Collard
Modified: 2016-05-10 21:41 UTC (History)
2 users (show)

See Also:
Kernel Version: 4.2.8
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Kelly Collard 2016-04-30 11:08:21 UTC
Package: e2fsprogs
Version: 1.42.12-1.1
Severity: normal
File: /sbin/mke2fs

When creating an ext3/ext4 filesystem the sparse_super2 option is ignored and defaults back to sparse_super when using extent or 64bit.
mke2fs should respect the use of sparse_super2 when using either or both -O extent or -O 64bit.


Normal formatting using sparse_super and works as expected creating 2 backup superblocks.

mke2fs /dev/sdq1 -t ext4 -b 4096 -O sparse_super2
mke2fs 1.42.12 (29-Aug-2014)
Creating filesystem with 61049344 4k blocks and 15269888 inodes
Filesystem UUID: cdaa09a3-dcb2-473a-9da8-7517a632db14
Superblock backups stored on blocks:
        32768, 61046784

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done



Using extent option with sparse_super2 creates more than 2 backup superblocks.


mke2fs /dev/sdq1 -t ext4 -b 4096 -O sparse_super2 -O extent
mke2fs 1.42.12 (29-Aug-2014)
Creating filesystem with 61049344 4k blocks and 15269888 inodes
Filesystem UUID: 4634627d-bd41-4f96-923d-21746f12cf1f
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632,   2654208,4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done



Using 64bit option with sparse_super2 creates more than 2 backup superblocks.


mke2fs /dev/sdq1 -t ext4 -b 4096 -O sparse_super2 -O 64bit
mke2fs 1.42.12 (29-Aug-2014)
Creating filesystem with 61049344 4k blocks and 15269888 inodes
Filesystem UUID: ef3ed24c-0183-40c9-b2de-0b8e9bb868bb
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done



mke2fs (mkfs.ext4) should respect the sparse_super2 option when used with 64bit or extent.




-- System Information:
Debian Release: 8.3
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.2.8-1-pve (SMP w/24 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages e2fsprogs depends on:
ii  e2fslibs    1.42.12-1.1
ii  libblkid1   2.25.2-6
ii  libc6       2.19-18+deb8u3
ii  libcomerr2  1.42.12-1.1
ii  libss2      1.42.12-1.1
ii  libuuid1    2.25.2-6
ii  util-linux  2.25.2-6


e2fsprogs recommends no packages.

Versions of packages e2fsprogs suggests:
pn  e2fsck-static  <none>
pn  gpart          <none>
ii  parted         3.2-7

-- no debconf information
Comment 1 Theodore Tso 2016-05-09 02:47:06 UTC
I'll add some checks so that e2fsck prints an error and explains what the user did wrong, but you are only supposed to specify the -O option once.  If you want to specify more than one file system feature to enable in addition to the ones enabled by -t ext4, the -O option takes a comma separated list, e.g.

e2fsck -O sparse_super2,64bit -t ext4 /dev/sdq1
Comment 2 Theodore Tso 2016-05-10 21:41:05 UTC
I've added a commit to e2fsprogs 1.43 (when it is released) so it will accept multiple -O options, since other people will likely make the same mistake.

Note You need to log in before you can comment on or make changes to this bug.