From: "Timo Schlüßler" <timo@schluessler.org>
To: linux-fsdevel@vger.kernel.org
Subject: [PATCH 1/2] HFSPlus: clear dirty flags on remount read-only
Date: Sun, 29 Nov 2015 15:59:24 +0100 [thread overview]
Message-ID: <565B12CC.6040909@schluessler.org> (raw)
Remounting a HFSPlus filesystem read-only doesn't clear the "DIRTY"-flags
(not HFSPLUS_VOL_UNMNT and HFSPLUS_VOL_INCNSTNT) correctly. Subsequent
mounts then report a dirty filesystem and enforce a check before willing
to mount it read-write again.
Signed-off-by: Timo Schlüßler <timo@schluessler.org>
---
--- linux/fs/hfsplus/super.c.orig 2015-11-22 20:11:25.000000000 +0100
+++ linux/fs/hfsplus/super.c 2015-11-22 20:14:38.000000000 +0100
@@ -325,11 +325,12 @@ static int hfsplus_statfs(struct dentry
static int hfsplus_remount(struct super_block *sb, int *flags, char *data)
{
+ struct hfsplus_vh *vhdr = HFSPLUS_SB(sb)->s_vhdr;
+
sync_filesystem(sb);
if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))
return 0;
if (!(*flags & MS_RDONLY)) {
- struct hfsplus_vh *vhdr = HFSPLUS_SB(sb)->s_vhdr;
int force = 0;
if (!hfsplus_parse_options_remount(data, &force))
@@ -352,6 +353,12 @@ static int hfsplus_remount(struct super_
sb->s_flags |= MS_RDONLY;
*flags |= MS_RDONLY;
}
+ } else {
+ vhdr->modify_date = hfsp_now2mt();
+ vhdr->attributes |= cpu_to_be32(HFSPLUS_VOL_UNMNT);
+ vhdr->attributes &= cpu_to_be32(~HFSPLUS_VOL_INCNSTNT);
+
+ hfsplus_sync_fs(sb, 1);
}
return 0;
}
next reply other threads:[~2015-11-29 15:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-29 14:59 Timo Schlüßler [this message]
2015-11-29 22:50 ` [PATCH 1/2] HFSPlus: clear dirty flags on remount read-only Vyacheslav Dubeyko
2015-12-03 18:38 ` Timo Schlüßler
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=565B12CC.6040909@schluessler.org \
--to=timo@schluessler.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 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.