ext4: do not allow journal_opts for fs w/o journal
authorDmitry Monakhov <dmonakhov@openvz.org>
Mon, 19 Oct 2015 03:50:26 +0000 (23:50 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 19 Oct 2015 03:50:26 +0000 (23:50 -0400)
commit1e381f60dad913625956ed3a9c5714d9fc7e865f
tree0087057e6ef3610cc5e1f197d8754e644d803567
parentc93cf2d75779d73376e84e2547de1304113d3f1c
ext4: do not allow journal_opts for fs w/o journal

It is appeared that we can pass journal related mount options and such options
be shown in /proc/mounts

Example:
#mkfs.ext4 -F /dev/vdb
#tune2fs -O ^has_journal /dev/vdb
#mount /dev/vdb /mnt/  -ocommit=20,journal_async_commit
#cat /proc/mounts  | grep /mnt
 /dev/vdb /mnt ext4 rw,relatime,journal_checksum,journal_async_commit,commit=20,data=ordered 0 0

But options:"journal_checksum,journal_async_commit,commit=20,data=ordered" has
nothing with reality because there is no journal at all.

This patch disallow following options for journalless configurations:
 - journal_checksum
 - journal_async_commit
 - commit=%ld
 - data={writeback,ordered,journal}

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
fs/ext4/ext4.h
fs/ext4/super.c