From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay08.alfahosting-server.de ([109.237.142.245]:38636 "EHLO relay08.alfahosting-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750759AbbK2PNH (ORCPT ); Sun, 29 Nov 2015 10:13:07 -0500 Received: from alfa3011.alfahosting-server.de (alfa3011.alfahosting-server.de [109.237.134.14]) by relay01.alfahosting-server.de (Postfix) with ESMTPS id 8025232C21FB for ; Sun, 29 Nov 2015 15:59:02 +0100 (CET) Received: from [192.168.1.26] (x5d82204b.dyn.telefonica.de [93.130.32.75]) by alfa3011.alfahosting-server.de (Postfix) with ESMTPSA id 5A02C3EF902A for ; Sun, 29 Nov 2015 15:59:02 +0100 (CET) From: =?UTF-8?Q?Timo_Schl=c3=bc=c3=9fler?= Subject: [PATCH 1/2] HFSPlus: clear dirty flags on remount read-only To: linux-fsdevel@vger.kernel.org Message-ID: <565B12CC.6040909@schluessler.org> Date: Sun, 29 Nov 2015 15:59:24 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 --- --- 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; }