]> git.baikalelectronics.ru Git - kernel.git/commit
UBIFS: introduce new flags for RO mounts
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Sun, 19 Sep 2010 15:34:26 +0000 (18:34 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Sun, 19 Sep 2010 18:07:58 +0000 (21:07 +0300)
commit944b0fb9dfa621192206437dc731844e372280db
tree877e1ece00c14de0f0d79e86b6480d284d309216
parentfbbd5ea10e13a2c7da96f8e71eeb893c8d161db0
UBIFS: introduce new flags for RO mounts

Commit ae641676134ca8f1d4239ec7034a6449da103450 "UBIFS: mark VFS SB RO too"
introduced regression. This commit made UBIFS set the 'MS_RDONLY' flag in the
VFS superblock when it switches to R/O mode due to an error. This was done
to make VFS show the R/O UBIFS flag in /proc/mounts.

However, several places in UBIFS relied on the 'MS_RDONLY' flag and assume this
flag can only change when we re-mount. For example, 'ubifs_put_super()'.

This patch introduces new UBIFS flag - 'c->ro_mount' which changes only when
we re-mount, and preserves the way UBIFS was originally mounted (R/W or R/O).
This allows us to de-initialize UBIFS cleanly in 'ubifs_put_super()'.

This patch also changes all 'ubifs_assert(!c->ro_media)' assertions to
'ubifs_assert(!c->ro_media && !c->ro_mount)', because we never should write
anything if the FS was mounter R/O.

All the places where we test for 'MS_RDONLY' flag in the VFS SB were changed
and now we test the 'c->ro_mount' flag instead, because it preserves the
original UBIFS mount type, unlike the 'MS_RDONLY' flag.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
14 files changed:
fs/ubifs/commit.c
fs/ubifs/file.c
fs/ubifs/gc.c
fs/ubifs/io.c
fs/ubifs/journal.c
fs/ubifs/log.c
fs/ubifs/master.c
fs/ubifs/misc.h
fs/ubifs/recovery.c
fs/ubifs/replay.c
fs/ubifs/sb.c
fs/ubifs/shrinker.c
fs/ubifs/super.c
fs/ubifs/ubifs.h