From mboxrd@z Thu Jan 1 00:00:00 1970 From: Warren Turkal Subject: [PATCH] Fix journal detection on HFS+. Date: Wed, 5 Nov 2008 00:00:26 -0800 Message-ID: <1225872026-13484-3-git-send-email-wt@penguintechs.org> References: <1225872026-13484-1-git-send-email-wt@penguintechs.org> <1225872026-13484-2-git-send-email-wt@penguintechs.org> Cc: Roman Zippel , Warren Turkal To: linux-fsdevel Return-path: Received: from wf-out-1314.google.com ([209.85.200.175]:31218 "EHLO wf-out-1314.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753358AbYKEIAc (ORCPT ); Wed, 5 Nov 2008 03:00:32 -0500 Received: by wf-out-1314.google.com with SMTP id 27so3705578wfd.4 for ; Wed, 05 Nov 2008 00:00:32 -0800 (PST) In-Reply-To: <1225872026-13484-2-git-send-email-wt@penguintechs.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: The code was unconditionally assumming that the volume had a jounal if the jounal 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. Signed-off-by: Warren Turkal --- fs/hfsplus/super.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c index eb74531..b12e767 100644 --- a/fs/hfsplus/super.c +++ b/fs/hfsplus/super.c @@ -260,7 +260,8 @@ static int hfsplus_remount(struct super_block *sb, int *flags, char *data) 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 (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED) && + vhdr->journal_info_block != cpu_to_be32(0)) { printk(KERN_WARNING "hfs: filesystem is marked journaled, leaving read-only.\n"); sb->s_flags |= MS_RDONLY; *flags |= MS_RDONLY; @@ -356,7 +357,9 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) } 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 ((vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) && + (be32_to_cpu(vhdr->journal_info_block) != 0) && + !(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; -- 1.5.6.3