The patch titled hfsplus: fix journal detection has been added to the -mm tree. Its filename is hfsplus-fix-journal-detection.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: hfsplus: fix journal detection From: Warren Turkal <wt@xxxxxxxxxxxxxxxx> The code currently mounts an HFS+ volume read-only (unless given the "force" mount option) if it detects that the HFS+ volume has a journal. The code was unconditionally assuming that the volume had a jounal if the journal attribute was set in the volume header. However, the volume also has to have a non-zero journal info block to actually have a journal. In this patch, I refactored the journal detection into a function since the logic is used twice. The journal detection also uses the better logic to determine if there is a journal. Signed-off-by: Warren Turkal <wt@xxxxxxxxxxxxxxxx> Cc: Roman Zippel <zippel@xxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/hfsplus/super.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff -puN fs/hfsplus/super.c~hfsplus-fix-journal-detection fs/hfsplus/super.c --- a/fs/hfsplus/super.c~hfsplus-fix-journal-detection +++ a/fs/hfsplus/super.c @@ -20,6 +20,12 @@ static void hfsplus_destroy_inode(struct #include "hfsplus_fs.h" +static bool hfsplus_vol_has_journal(struct hfsplus_vh *vhdr) +{ + return (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED) && + vhdr->journal_info_block); +} + struct inode *hfsplus_iget(struct super_block *sb, unsigned long ino) { struct hfs_find_data fd; @@ -260,7 +266,7 @@ static int hfsplus_remount(struct super_ printk(KERN_WARNING "hfs: filesystem is marked locked, leaving read-only.\n"); sb->s_flags |= MS_RDONLY; *flags |= MS_RDONLY; - } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) { + } else if (hfsplus_vol_has_journal(vhdr)) { printk(KERN_WARNING "hfs: filesystem is marked journaled, leaving read-only.\n"); sb->s_flags |= MS_RDONLY; *flags |= MS_RDONLY; @@ -356,7 +362,7 @@ static int hfsplus_fill_super(struct sup } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { printk(KERN_WARNING "hfs: Filesystem is marked locked, mounting read-only.\n"); sb->s_flags |= MS_RDONLY; - } else if ((vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) && !(sb->s_flags & MS_RDONLY)) { + } else if (hfsplus_vol_has_journal(vhdr) && !(sb->s_flags & MS_RDONLY)) { printk(KERN_WARNING "hfs: write access to a journaled filesystem is not supported, " "use the force option at your own risk, mounting read-only.\n"); sb->s_flags |= MS_RDONLY; _ Patches currently in -mm which might be from wt@xxxxxxxxxxxxxxxx are hfsplus-identify-journal-info-block-in-volume-header.patch hfsplus-fix-journal-detection.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html