From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f41.google.com ([209.85.220.41]:35477 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750759AbbK2Wun (ORCPT ); Sun, 29 Nov 2015 17:50:43 -0500 Received: by pacej9 with SMTP id ej9so163885582pac.2 for ; Sun, 29 Nov 2015 14:50:42 -0800 (PST) Message-ID: <1448837441.4582.6.camel@ubuntu-slavad-14.04> Subject: Re: [PATCH 1/2] HFSPlus: clear dirty flags on remount read-only From: Vyacheslav Dubeyko To: Timo =?ISO-8859-1?Q?Schl=FC=DFler?= Cc: linux-fsdevel@vger.kernel.org Date: Sun, 29 Nov 2015 14:50:41 -0800 In-Reply-To: <565B12CC.6040909@schluessler.org> References: <565B12CC.6040909@schluessler.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi Timo, On Sun, 2015-11-29 at 15:59 +0100, Timo Schlüßler wrote: > 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); If you set HFSPLUS_VOL_UNMNT and clear HFSPLUS_VOL_INCNSTNT bits on operation of remount in READ-ONLY state then you should do opposite operation on remount in READ-WRITE state. But, as far as I can judge, you've missed this change. Such modification should be in the same patch. > + > + hfsplus_sync_fs(sb, 1); Are you sure that hfsplus_sync_fs() should be called here? As far as I can see, sync_filesystem() does it for you. What the reason for second call? Or do I miss something? Thanks, Vyacheslav Dubeyko.