Bug 839466 - ext4: ext4 driver should reject nonsensical mount options for ext2 and ext3
Summary: ext4: ext4 driver should reject nonsensical mount options for ext2 and ext3
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: kernel
Version: 7.0
Hardware: All
OS: Linux
medium
low
Target Milestone: rc
: ---
Assignee: Carlos Maiolino
QA Contact: Murphy Zhou
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-12 03:15 UTC by Eryu Guan
Modified: 2015-11-19 19:57 UTC (History)
6 users (show)

Fixed In Version: kernel-3.10.0-313.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 19:57:09 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:2152 normal SHIPPED_LIVE Important: kernel security, bug fix, and enhancement update 2015-11-20 00:56:02 UTC

Description Eryu Guan 2012-07-12 03:15:04 UTC
Description of problem:
mount ext3 with ext4-only mount options should fail
eg. mount -t ext3 -o journal_checksum $dev $mnt
mount -t ext2 -o commit=10 $dev $mnt

I go through the mount manpage and made a list of mount options that should be rejected. (I may miss some options, this is what I can find in the manpage)

ext3:
journal_checksum
journal_async_commit
inode_readahead=n
stripe=n
delalloc/nodelalloc
max_batch_time=usec/min_batch_time=usec
journal_ioprio=prio (0-7)
auto_da_alloc/noauto_da_alloc
discard/nodiscard
block_validity/noblock_validity
dioread_lock/dioread_nolock
i_version 

ext2:
All options listed in ext3 section
journal=update
norecovery/noload
data={journal|ordered|writeback}
barrier=0 / barrier=1
commit=nrsec
abort 

Version-Release number of selected component (if applicable):
kernel-3.3.0-0.19.el7

Comment 9 Eryu Guan 2013-11-22 09:47:08 UTC
Hi Carlos,

Yes, I saw some of the mount options were rejected when mounting ext2. But not all the options listed in comment 0 are rejected.

Do we have a well-defined acceptable option list for ext2 and ext3? If no do we want to work out one?

Test on ext2 and results are as below now, kenrel-3.10.0-51.el7

  journal_checksum                 PASS
  journal_async_commit             PASS
  inode_readahead_blks=32          FAIL(mount  should  fail,  but  passed)
  stripe=4                         FAIL(mount  should  fail,  but  passed)
  delalloc                         PASS
  nodelalloc                       PASS
  max_batch_time=5                 FAIL(mount  should  fail,  but  passed)
  min_batch_time=5                 FAIL(mount  should  fail,  but  passed)
  journal_ioprio=5                 FAIL(mount  should  fail,  but  passed)
  auto_da_alloc                    FAIL(mount  should  fail,  but  passed)
  noauto_da_alloc                  FAIL(mount  should  fail,  but  passed)
  discard                          FAIL(mount  should  fail,  but  passed)
  nodiscard                        FAIL(mount  should  fail,  but  passed)
  block_validity                   FAIL(mount  should  fail,  but  passed)
  noblock_validity                 FAIL(mount  should  fail,  but  passed)
  dioread_lock                     PASS
  dioread_nolock                   PASS
  i_version                        FAIL(mount  should  fail,  but  passed)
  journal=update                   PASS
  journal=11                       FAIL(mount  should  fail,  but  passed)
  journal_dev=/dev/loop0           PASS
  norecovery                       PASS
  noload                           PASS
  data=journal                     PASS
  data=ordered                     PASS
  data=writeback                   PASS
  barrier=1                        FAIL(mount  should  fail,  but  passed)
  barrier                          FAIL(mount  should  fail,  but  passed)
  nobarrier                        FAIL(mount  should  fail,  but  passed)
  commit=5                         FAIL(mount  should  fail,  but  passed)
  abort                            FAIL(mount  should  fail,  but  passed)

Thanks,
Eryu

Comment 10 Carlos Maiolino 2013-11-22 13:24:13 UTC
Hi Eryu.

Thanks, this is a good report of options you guys are testing :)

Although some of these options I believe that should be kept available to all Ext versions, like discard, I agree some of them like barrier on ext2 should be rejected, since these controls how journal commit ordering. But some of them, like 'discard' looks reasonable to have them enabled for any Ext version.

Anyway, let me talk with upstream folks and I get back to you.

Thanks again for this report

Comment 11 Ludek Smid 2014-06-26 10:43:20 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

Comment 12 Ludek Smid 2014-06-26 11:15:14 UTC
The comment above is incorrect. The correct version is bellow.
I'm sorry for any inconvenience.
---------------------------------------------------------------

This request was NOT resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you need
to escalate this bug.

Comment 14 Eryu Guan 2015-01-07 12:00:21 UTC
I agree that options like discard block_validity are reasonable to keep on ext2/3, but the following two options are journal related mount options, I think ext2 should reject them.

journal_ioprio=5                 FAIL(mount  should  fail,  but  passed)
journal=11                       FAIL(mount  should  fail,  but  passed)


And I'll update the test case to mark the following options as accepted, so they won't fail the test anymore(left journal_ioprio and journa=11 untouched for now, will update test when there's a final decision)

  inode_readahead_blks=32          FAIL(mount  should  fail,  but  passed)
  stripe=4                         FAIL(mount  should  fail,  but  passed)
  max_batch_time=5                 FAIL(mount  should  fail,  but  passed)
  min_batch_time=5                 FAIL(mount  should  fail,  but  passed)
  auto_da_alloc                    FAIL(mount  should  fail,  but  passed)
  noauto_da_alloc                  FAIL(mount  should  fail,  but  passed)
  discard                          FAIL(mount  should  fail,  but  passed)
  nodiscard                        FAIL(mount  should  fail,  but  passed)
  block_validity                   FAIL(mount  should  fail,  but  passed)
  noblock_validity                 FAIL(mount  should  fail,  but  passed)
  i_version                        FAIL(mount  should  fail,  but  passed)
  barrier=1                        FAIL(mount  should  fail,  but  passed)
  barrier                          FAIL(mount  should  fail,  but  passed)
  nobarrier                        FAIL(mount  should  fail,  but  passed)
  commit=5                         FAIL(mount  should  fail,  but  passed)
  abort                            FAIL(mount  should  fail,  but  passed)

Comment 15 Carlos Maiolino 2015-01-07 13:22:52 UTC
I agree with you Eryu, there is no reason to keep journal options with ext2 filesystems, I'll try to send a patch upstream disabling these options for ext2 filesystems, and see what happens, and I let you know.

Comment 19 Rafael Aquini 2015-09-01 14:31:57 UTC
Patch(es) available on kernel-3.10.0-313.el7

Comment 24 errata-xmlrpc 2015-11-19 19:57:09 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-2152.html


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