From: Roman Zippel hfs has two dirty bits, but currently OS X uses only one of them, so match its behaviour, so that a uncleanly unmounted disk can be mounted r/w again, after it has been checked. Signed-off-by: Roman Zippel Signed-off-by: Andrew Morton --- 25-akpm/fs/hfs/mdb.c | 8 ++++---- 25-akpm/fs/hfs/super.c | 3 +-- 25-akpm/fs/hfsplus/super.c | 6 ++---- 3 files changed, 7 insertions(+), 10 deletions(-) diff -puN fs/hfs/mdb.c~hfs-relax-dirty-check fs/hfs/mdb.c --- 25/fs/hfs/mdb.c~hfs-relax-dirty-check Wed Oct 20 16:41:20 2004 +++ 25-akpm/fs/hfs/mdb.c Wed Oct 20 16:41:20 2004 @@ -200,8 +200,7 @@ int hfs_mdb_get(struct super_block *sb) } attrib = mdb->drAtrb; - if (!(attrib & cpu_to_be16(HFS_SB_ATTRIB_UNMNT)) - || (attrib & cpu_to_be16(HFS_SB_ATTRIB_INCNSTNT))) { + if (!(attrib & cpu_to_be16(HFS_SB_ATTRIB_UNMNT))) { hfs_warn("HFS-fs warning: Filesystem was not cleanly unmounted, " "running fsck.hfs is recommended. mounting read-only.\n"); sb->s_flags |= MS_RDONLY; @@ -212,8 +211,9 @@ int hfs_mdb_get(struct super_block *sb) } if (!(sb->s_flags & MS_RDONLY)) { /* Mark the volume uncleanly unmounted in case we crash */ - mdb->drAtrb = attrib & cpu_to_be16(~HFS_SB_ATTRIB_UNMNT); - mdb->drAtrb = attrib | cpu_to_be16(HFS_SB_ATTRIB_INCNSTNT); + attrib &= cpu_to_be16(~HFS_SB_ATTRIB_UNMNT); + attrib |= cpu_to_be16(HFS_SB_ATTRIB_INCNSTNT); + mdb->drAtrb = attrib; mdb->drWrCnt = cpu_to_be32(be32_to_cpu(mdb->drWrCnt) + 1); mdb->drLsMod = hfs_mtime(); diff -puN fs/hfsplus/super.c~hfs-relax-dirty-check fs/hfsplus/super.c --- 25/fs/hfsplus/super.c~hfs-relax-dirty-check Wed Oct 20 16:41:20 2004 +++ 25-akpm/fs/hfsplus/super.c Wed Oct 20 16:41:20 2004 @@ -246,8 +246,7 @@ int hfsplus_remount(struct super_block * if (!(*flags & MS_RDONLY)) { struct hfsplus_vh *vhdr = HFSPLUS_SB(sb).s_vhdr; - if ((vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_INCNSTNT)) || - !(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) { + 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; @@ -332,8 +331,7 @@ static int hfsplus_fill_super(struct sup sb->s_op = &hfsplus_sops; sb->s_maxbytes = MAX_LFS_FILESIZE; - if ((vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_INCNSTNT)) || - !(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) { + 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"); diff -puN fs/hfs/super.c~hfs-relax-dirty-check fs/hfs/super.c --- 25/fs/hfs/super.c~hfs-relax-dirty-check Wed Oct 20 16:41:20 2004 +++ 25-akpm/fs/hfs/super.c Wed Oct 20 16:41:20 2004 @@ -98,8 +98,7 @@ int hfs_remount(struct super_block *sb, if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) return 0; if (!(*flags & MS_RDONLY)) { - if (!(HFS_SB(sb)->mdb->drAtrb & cpu_to_be16(HFS_SB_ATTRIB_UNMNT)) - || (HFS_SB(sb)->mdb->drAtrb & cpu_to_be16(HFS_SB_ATTRIB_INCNSTNT))) { + if (!(HFS_SB(sb)->mdb->drAtrb & cpu_to_be16(HFS_SB_ATTRIB_UNMNT))) { printk("HFS-fs warning: Filesystem was not cleanly unmounted, " "running fsck.hfs is recommended. leaving read-only.\n"); sb->s_flags |= MS_RDONLY; _