UBIFS: introduce new flags for RO mounts
Artem Bityutskiy authored
Commit 2fde99cb

 "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: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
2ef13294
Name Last commit Last update
..
9p v9fs: fixup for inode_setattr being removed
adfs check ATTR_SIZE contraints in inode_change_ok
affs AFFS: wait for sb synchronization when needed
afs Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
autofs autofs/autofs4: Move compat_ioctl handling into fs
autofs4 autofs4: remove unneeded null check in try_to_fill_dentry()
befs fix typos concerning "initiali[zs]e"
bfs BFS: clean up the superblock usage
btrfs Merge branch 'for-2.6.36' of git://git.kernel.dk/linux-2.6-block
cachefiles Add a dummy printk function for the maintenance of unused printks
ceph ceph: fix get_ticket_handler() error handling
cifs Cannot allocate memory error on mount
coda Merge branch 'for-2.6.36' of git://git.kernel.dk/linux-2.6-block
configfs fix setattr error handling in sysfs, configfs
cramfs cramfs: only unlock new inodes
debugfs Add x64 support to debugfs
devpts Simplify devpts_get_sb() failure exits
dlm fs/dlm: Drop unnecessary null test
ecryptfs eCryptfs: Fix encrypted file name lookup regression
efs get rid of BKL in fs/efs
exofs Merge branch 'for-linus' of git://git.open-osd.org/linux-open-osd
exportfs nfs: new subdir Documentation/filesystems/nfs
ext2 mbcache: Remove unused features
ext3 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
ext4 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
fat
freevxfs
fscache
fuse
gfs2
hfs
hfsplus
hostfs
hpfs
hppfs
hugetlbfs
isofs
jbd
jbd2
jffs2
jfs
lockd
logfs
minix
ncpfs
nfs
nfs_common
nfsd
nilfs2
nls
notify
ntfs
ocfs2
omfs
openpromfs
partitions
proc
qnx4
quota
ramfs
reiserfs
romfs
smbfs
squashfs
sysfs
sysv
ubifs
udf
ufs
xfs
Kconfig
Kconfig.binfmt
Makefile
aio.c
anon_inodes.c
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf.c
binfmt_elf_fdpic.c
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
binfmt_som.c
bio-integrity.c
bio.c
block_dev.c
buffer.c
char_dev.c
compat.c
compat_binfmt_elf.c
compat_ioctl.c
dcache.c
dcookies.c
direct-io.c
drop_caches.c
eventfd.c
eventpoll.c
exec.c
fcntl.c
fifo.c
file.c
file_table.c
filesystems.c
fs-writeback.c
fs_struct.c
generic_acl.c
inode.c
internal.h
ioctl.c
ioprio.c
libfs.c
locks.c
mbcache.c
mpage.c
namei.c
namespace.c
nfsctl.c
no-block.c
open.c
pipe.c
pnode.c
pnode.h
posix_acl.c
read_write.c
read_write.h
readdir.c
select.c
seq_file.c
signalfd.c
splice.c
stack.c
stat.c
statfs.c
super.c
sync.c
timerfd.c
utimes.c
xattr.c
xattr_acl.c