--- a/fs/hfsplus/super.c 2005-04-20 21:13:49.000000000 +0200 +++ b/fs/hfsplus/super.c 2005-04-20 21:51:03.000000000 +0200 @@ -17,6 +17,9 @@ #include #include #include +#include + +static int force_rw = 0; static struct inode *hfsplus_alloc_inode(struct super_block *sb); static void hfsplus_destroy_inode(struct inode *inode); @@ -251,9 +254,12 @@ if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) { printk("HFS+-fs warning: Filesystem was not cleanly unmounted, " - "running fsck.hfsplus is recommended. leaving read-only.\n"); - sb->s_flags |= MS_RDONLY; - *flags |= MS_RDONLY; + "running fsck.hfsplus is recommended. leaving read-%s.\n", + force_rw ? "write":"only"); + if (!force_rw) { + sb->s_flags |= MS_RDONLY; + *flags |= MS_RDONLY; + } } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { printk("HFS+-fs: Filesystem is marked locked, leaving read-only.\n"); sb->s_flags |= MS_RDONLY; @@ -346,8 +352,10 @@ if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) { if (!silent) printk("HFS+-fs warning: Filesystem was not cleanly unmounted, " - "running fsck.hfsplus is recommended. mounting read-only.\n"); - sb->s_flags |= MS_RDONLY; + "running fsck.hfsplus is recommended. mounting read-%s.\n", + force_rw ? "write":"only"); + if (!force_rw) + sb->s_flags |= MS_RDONLY; } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { if (!silent) printk("HFS+-fs: Filesystem is marked locked, mounting read-only.\n"); @@ -437,6 +445,9 @@ MODULE_DESCRIPTION("Extended Macintosh Filesystem"); MODULE_LICENSE("GPL"); +module_param(force_rw, int, 0644); +MODULE_PARM_DESC(force_rw,"Force r/w mounting (DANGEROUS)."); + static kmem_cache_t *hfsplus_inode_cachep; static struct inode *hfsplus_alloc_inode(struct super_block *sb)