linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roman Zippel <zippel@linux-m68k.org>
To: Andrew Morton <akpm@osdl.org>, linux-fsdevel@vger.kernel.org
Subject: [PATCH 2/6] relax dirty check
Date: Thu, 21 Oct 2004 01:13:12 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.61.0410210112490.1068@scrub.home> (raw)


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 <zippel@linux-m68k.org>

Index: linux-2.6-hfs/fs/hfs/mdb.c
===================================================================
--- linux-2.6-hfs.orig/fs/hfs/mdb.c	2004-10-19 19:34:42.000000000 +0200
+++ linux-2.6-hfs/fs/hfs/mdb.c	2004-10-21 00:43:00.652087825 +0200
@@ -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();
 
Index: linux-2.6-hfs/fs/hfs/super.c
===================================================================
--- linux-2.6-hfs.orig/fs/hfs/super.c	2004-10-19 19:34:42.000000000 +0200
+++ linux-2.6-hfs/fs/hfs/super.c	2004-10-21 00:43:00.652087825 +0200
@@ -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;
Index: linux-2.6-hfs/fs/hfsplus/super.c
===================================================================
--- linux-2.6-hfs.orig/fs/hfsplus/super.c	2004-10-19 19:34:43.000000000 +0200
+++ linux-2.6-hfs/fs/hfsplus/super.c	2004-10-21 00:43:00.683082502 +0200
@@ -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");

                 reply	other threads:[~2004-10-20 23:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=Pine.LNX.4.61.0410210112490.1068@scrub.home \
    --to=zippel@linux-m68k.org \
    --cc=akpm@osdl.org \
    --cc=linux-fsdevel@vger.kernel.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).