aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfsplus/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/hfsplus/super.c')
-rw-r--r--fs/hfsplus/super.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
index 0ce1c455ae55..8093351bd7c3 100644
--- a/fs/hfsplus/super.c
+++ b/fs/hfsplus/super.c
@@ -251,16 +251,28 @@ static int hfsplus_remount(struct super_block *sb, int *flags, char *data)
251 return 0; 251 return 0;
252 if (!(*flags & MS_RDONLY)) { 252 if (!(*flags & MS_RDONLY)) {
253 struct hfsplus_vh *vhdr = HFSPLUS_SB(sb).s_vhdr; 253 struct hfsplus_vh *vhdr = HFSPLUS_SB(sb).s_vhdr;
254 struct hfsplus_sb_info sbi;
255
256 memset(&sbi, 0, sizeof(struct hfsplus_sb_info));
257 sbi.nls = HFSPLUS_SB(sb).nls;
258 if (!hfsplus_parse_options(data, &sbi))
259 return -EINVAL;
254 260
255 if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) { 261 if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) {
256 printk("HFS+-fs warning: Filesystem was not cleanly unmounted, " 262 printk("HFS+-fs warning: Filesystem was not cleanly unmounted, "
257 "running fsck.hfsplus is recommended. leaving read-only.\n"); 263 "running fsck.hfsplus is recommended. leaving read-only.\n");
258 sb->s_flags |= MS_RDONLY; 264 sb->s_flags |= MS_RDONLY;
259 *flags |= MS_RDONLY; 265 *flags |= MS_RDONLY;
266 } else if (sbi.flags & HFSPLUS_SB_FORCE) {
267 /* nothing */
260 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { 268 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) {
261 printk("HFS+-fs: Filesystem is marked locked, leaving read-only.\n"); 269 printk("HFS+-fs: Filesystem is marked locked, leaving read-only.\n");
262 sb->s_flags |= MS_RDONLY; 270 sb->s_flags |= MS_RDONLY;
263 *flags |= MS_RDONLY; 271 *flags |= MS_RDONLY;
272 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) {
273 printk("HFS+-fs: Filesystem is marked journaled, leaving read-only.\n");
274 sb->s_flags |= MS_RDONLY;
275 *flags |= MS_RDONLY;
264 } 276 }
265 } 277 }
266 return 0; 278 return 0;
@@ -352,11 +364,19 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
352 printk("HFS+-fs warning: Filesystem was not cleanly unmounted, " 364 printk("HFS+-fs warning: Filesystem was not cleanly unmounted, "
353 "running fsck.hfsplus is recommended. mounting read-only.\n"); 365 "running fsck.hfsplus is recommended. mounting read-only.\n");
354 sb->s_flags |= MS_RDONLY; 366 sb->s_flags |= MS_RDONLY;
367 } else if (sbi->flags & HFSPLUS_SB_FORCE) {
368 /* nothing */
355 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { 369 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) {
356 if (!silent) 370 if (!silent)
357 printk("HFS+-fs: Filesystem is marked locked, mounting read-only.\n"); 371 printk("HFS+-fs: Filesystem is marked locked, mounting read-only.\n");
358 sb->s_flags |= MS_RDONLY; 372 sb->s_flags |= MS_RDONLY;
373 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) {
374 if (!silent)
375 printk("HFS+-fs: write access to a jounaled filesystem is not supported, "
376 "use the force option at your own risk, mounting read-only.\n");
377 sb->s_flags |= MS_RDONLY;
359 } 378 }
379 sbi->flags &= ~HFSPLUS_SB_FORCE;
360 380
361 /* Load metadata objects (B*Trees) */ 381 /* Load metadata objects (B*Trees) */
362 HFSPLUS_SB(sb).ext_tree = hfs_btree_open(sb, HFSPLUS_EXT_CNID); 382 HFSPLUS_SB(sb).ext_tree = hfs_btree_open(sb, HFSPLUS_EXT_CNID);