linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Warren Turkal <wt@penguintechs.org>
To: linux-fsdevel <linux-fsdevel@vger.kernel.org>
Cc: Roman Zippel <zippel@linux-m68k.org>,
	Warren Turkal <wt@penguintechs.org>
Subject: [PATCH] Fix journal detection on HFS+.
Date: Wed,  5 Nov 2008 00:00:26 -0800	[thread overview]
Message-ID: <1225872026-13484-3-git-send-email-wt@penguintechs.org> (raw)
In-Reply-To: <1225872026-13484-2-git-send-email-wt@penguintechs.org>

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 <wt@penguintechs.org>
---
 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


  reply	other threads:[~2008-11-05  8:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-05  8:00 hfsplus journal detection Warren Turkal
2008-11-05  8:00 ` [PATCH] Identify journal info block in volume header Warren Turkal
2008-11-05  8:00   ` Warren Turkal [this message]
2008-11-05 10:40     ` [PATCH] Fix journal detection on HFS+ Jörn Engel
2008-11-05 14:09       ` Christoph Hellwig
2008-11-06  7:44         ` hfsplus journal detection - next try Warren Turkal
2008-11-06  7:44           ` [PATCH] Identify journal info block in volume header Warren Turkal
2008-11-06  7:44             ` [PATCH] Fix journal detection on HFS+ Warren Turkal
2008-11-07  8:32               ` Jörn Engel
2008-11-07 18:01                 ` Warren Turkal
2008-11-08 11:09                   ` Jörn Engel
2008-11-09  5:27                     ` Warren Turkal
2008-11-09 11:02                       ` Jörn Engel
  -- strict thread matches above, loose matches on Subject: below --
2008-11-08  8:55 hfsplus journal detection - try 3 Warren Turkal
2008-11-08  8:55 ` [PATCH] Identify journal info block in volume header Warren Turkal
2008-11-08  8:55   ` [PATCH] Fix journal detection on HFS+ Warren Turkal
2008-11-11 20:56 hfsplus journal detection - try 4 Warren Turkal
2008-11-11 20:56 ` [PATCH] Identify journal info block in volume header Warren Turkal
2008-11-11 20:56   ` [PATCH] Fix journal detection on HFS+ Warren Turkal
2008-11-19 22:51     ` Andrew Morton
2008-11-20  1:01       ` Warren Turkal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1225872026-13484-3-git-send-email-wt@penguintechs.org \
    --to=wt@penguintechs.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=zippel@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).