aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/ubifs.h
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-09-19 11:34:26 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-09-19 14:07:58 -0400
commit2ef13294d29bcfb306e0d360f1b97f37b647b0c0 (patch)
tree877e1ece00c14de0f0d79e86b6480d284d309216 /fs/ubifs/ubifs.h
parent2680d722bf2c5f75225dd9acb3ec9e5a9e2652f4 (diff)
UBIFS: introduce new flags for RO mounts
Commit 2fde99cb55fb9d9b88180512a5e8a5d939d27fec "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>
Diffstat (limited to 'fs/ubifs/ubifs.h')
-rw-r--r--fs/ubifs/ubifs.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h
index f47ebb442d1c..381d6b207a52 100644
--- a/fs/ubifs/ubifs.h
+++ b/fs/ubifs/ubifs.h
@@ -1032,6 +1032,7 @@ struct ubifs_debug_info;
1032 * @max_leb_cnt: maximum count of logical eraseblocks 1032 * @max_leb_cnt: maximum count of logical eraseblocks
1033 * @old_leb_cnt: count of logical eraseblocks before re-size 1033 * @old_leb_cnt: count of logical eraseblocks before re-size
1034 * @ro_media: the underlying UBI volume is read-only 1034 * @ro_media: the underlying UBI volume is read-only
1035 * @ro_mount: the file-system was mounted as read-only
1035 * @ro_error: UBIFS switched to R/O mode because an error happened 1036 * @ro_error: UBIFS switched to R/O mode because an error happened
1036 * 1037 *
1037 * @dirty_pg_cnt: number of dirty pages (not used) 1038 * @dirty_pg_cnt: number of dirty pages (not used)
@@ -1173,11 +1174,14 @@ struct ubifs_debug_info;
1173 * @replay_sqnum: sequence number of node currently being replayed 1174 * @replay_sqnum: sequence number of node currently being replayed
1174 * @need_recovery: file-system needs recovery 1175 * @need_recovery: file-system needs recovery
1175 * @replaying: set to %1 during journal replay 1176 * @replaying: set to %1 during journal replay
1176 * @unclean_leb_list: LEBs to recover when mounting ro to rw 1177 * @unclean_leb_list: LEBs to recover when re-mounting R/O mounted FS to R/W
1177 * @rcvrd_mst_node: recovered master node to write when mounting ro to rw 1178 * mode
1179 * @rcvrd_mst_node: recovered master node to write when re-mounting R/O mounted
1180 * FS to R/W mode
1178 * @size_tree: inode size information for recovery 1181 * @size_tree: inode size information for recovery
1179 * @remounting_rw: set while remounting from ro to rw (sb flags have MS_RDONLY) 1182 * @remounting_rw: set while re-mounting from R/O mode to R/W mode
1180 * @always_chk_crc: always check CRCs (while mounting and remounting rw) 1183 * @always_chk_crc: always check CRCs (while mounting and remounting to R/W
1184 * mode)
1181 * @mount_opts: UBIFS-specific mount options 1185 * @mount_opts: UBIFS-specific mount options
1182 * 1186 *
1183 * @dbg: debugging-related information 1187 * @dbg: debugging-related information
@@ -1274,6 +1278,7 @@ struct ubifs_info {
1274 int max_leb_cnt; 1278 int max_leb_cnt;
1275 int old_leb_cnt; 1279 int old_leb_cnt;
1276 unsigned int ro_media:1; 1280 unsigned int ro_media:1;
1281 unsigned int ro_mount:1;
1277 unsigned int ro_error:1; 1282 unsigned int ro_error:1;
1278 1283
1279 atomic_long_t dirty_pg_cnt; 1284 atomic_long_t dirty_pg_cnt;