[PATCH 1/2] HFSPlus: clear dirty flags on remount read-only

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx>
---

--- 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;
 }


--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux