ext4: don't try to modify s_flags if the the file system is read-only
authorTheodore Ts'o <tytso@mit.edu>
Wed, 12 Feb 2014 17:16:04 +0000 (12:16 -0500)
committerJiri Slaby <jslaby@suse.cz>
Wed, 5 Mar 2014 16:13:39 +0000 (17:13 +0100)
commit793602145273c0acfe0f6390e90977b49eecedd2
tree73da7dfcdf1bafec2cf8dd6d439927996c4af436
parent0e2747f274ec5dbb37ef7c8a14cdd93fa2364bdf
ext4: don't try to modify s_flags if the the file system is read-only

commit 23301410972330c0ae9a8afc379ba2005e249cc6 upstream.

If an ext4 file system is created by some tool other than mke2fs
(perhaps by someone who has a pathalogical fear of the GPL) that
doesn't set one or the other of the EXT2_FLAGS_{UN}SIGNED_HASH flags,
and that file system is then mounted read-only, don't try to modify
the s_flags field.  Otherwise, if dm_verity is in use, the superblock
will change, causing an dm_verity failure.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
fs/ext4/super.c