All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hfsplus: don't modify journaled volume
@ 2005-11-03 15:19 Roman Zippel
  2005-11-05  5:02 ` Andrew Morton
  0 siblings, 1 reply; 8+ messages in thread
From: Roman Zippel @ 2005-11-03 15:19 UTC (permalink / raw)
  To: Andrew Morton, linux-kernel


Until support for HFS+ journaling is supported and the journal can be 
replayed, don't modify a journaled volume.

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>

---

 fs/hfsplus/hfsplus_raw.h |   12 +++++++-----
 fs/hfsplus/super.c       |    8 ++++++++
 2 files changed, 15 insertions(+), 5 deletions(-)

Index: linux-2.6/fs/hfsplus/hfsplus_raw.h
===================================================================
--- linux-2.6.orig/fs/hfsplus/hfsplus_raw.h	2005-11-03 16:15:40.000000000 +0100
+++ linux-2.6/fs/hfsplus/hfsplus_raw.h	2005-11-03 16:15:44.000000000 +0100
@@ -123,11 +123,13 @@ struct hfsplus_vh {
 } __packed;
 
 /* HFS+ volume attributes */
-#define HFSPLUS_VOL_UNMNT     (1 << 8)
-#define HFSPLUS_VOL_SPARE_BLK (1 << 9)
-#define HFSPLUS_VOL_NOCACHE   (1 << 10)
-#define HFSPLUS_VOL_INCNSTNT  (1 << 11)
-#define HFSPLUS_VOL_SOFTLOCK  (1 << 15)
+#define HFSPLUS_VOL_UNMNT		(1 << 8)
+#define HFSPLUS_VOL_SPARE_BLK		(1 << 9)
+#define HFSPLUS_VOL_NOCACHE		(1 << 10)
+#define HFSPLUS_VOL_INCNSTNT		(1 << 11)
+#define HFSPLUS_VOL_NODEID_REUSED	(1 << 12)
+#define HFSPLUS_VOL_JOURNALED		(1 << 13)
+#define HFSPLUS_VOL_SOFTLOCK		(1 << 15)
 
 /* HFS+ BTree node descriptor */
 struct hfs_bnode_desc {
Index: linux-2.6/fs/hfsplus/super.c
===================================================================
--- linux-2.6.orig/fs/hfsplus/super.c	2005-11-03 16:15:40.000000000 +0100
+++ linux-2.6/fs/hfsplus/super.c	2005-11-03 16:15:44.000000000 +0100
@@ -262,6 +262,10 @@ static int hfsplus_remount(struct super_
 			printk("HFS+-fs: 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)) {
+			printk("HFS+-fs: Filesystem is marked journaled, leaving read-only.\n");
+			sb->s_flags |= MS_RDONLY;
+			*flags |= MS_RDONLY;
 		}
 	}
 	return 0;
@@ -357,6 +361,10 @@ static int hfsplus_fill_super(struct sup
 		if (!silent)
 			printk("HFS+-fs: Filesystem is marked locked, mounting read-only.\n");
 		sb->s_flags |= MS_RDONLY;
+	} else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) {
+		if (!silent)
+			printk("HFS+-fs: Filesystem is marked journaled, mounting read-only.\n");
+		sb->s_flags |= MS_RDONLY;
 	}
 
 	/* Load metadata objects (B*Trees) */

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-11-07 11:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-03 15:19 [PATCH] hfsplus: don't modify journaled volume Roman Zippel
2005-11-05  5:02 ` Andrew Morton
2005-11-05 10:13   ` Anton Altaparmakov
2005-11-05 13:38     ` Anton Altaparmakov
2005-11-05 21:48       ` Roman Zippel
2005-11-05 21:58         ` Anton Altaparmakov
2005-11-06  1:25           ` Rogério Brito
2005-11-07 11:56           ` Roman Zippel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.