]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ext4: Fix optional-arg mount options
authorEric Sandeen <sandeen@redhat.com>
Tue, 16 Feb 2010 01:17:55 +0000 (20:17 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 13 Aug 2010 20:20:18 +0000 (13:20 -0700)
commit670a13a74e34d9fff0cd03df73d8a2b77f7decb7
tree09fa8e8a169b32b64c65b15d4d9e8969908a726d
parentc60ca6232164fc6abea21bcf3f58172607f491e5
ext4: Fix optional-arg mount options

commit 15121c18a22ae483279f76dc9e554334b800d0f7 upstream.

We have 2 mount options, "barrier" and "auto_da_alloc" which may or
may not take a 1/0 argument.  This causes the ext4 superblock mount
code to subtract uninitialized pointers and pass the result to
kmalloc, which results in very noisy failures.

Per Ted's suggestion, initialize the args struct so that
we know whether match_token() found an argument for the
option, and skip match_int() if not.

Also, return error (0) from parse_options if we thought
we found an argument, but match_int() Fails.

Reported-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Acked-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ext4/super.c