From: Karel Zak Subject: Re: Lazytime undone by/not working with remount? Date: Mon, 18 May 2015 10:21:35 +0200 Message-ID: <20150518082135.GK4834@ws.net.home> References: <55575399.6010801@googlemail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-ext4@vger.kernel.org, "Theodore Ts'o" To: Holger =?iso-8859-1?Q?Hoffst=E4tte?= Return-path: Received: from mx1.redhat.com ([209.132.183.28]:56378 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750949AbbERIVm (ORCPT ); Mon, 18 May 2015 04:21:42 -0400 Content-Disposition: inline In-Reply-To: <55575399.6010801@googlemail.com> Sender: linux-ext4-owner@vger.kernel.org List-ID: On Sat, May 16, 2015 at 04:26:33PM +0200, Holger Hoffst=E4tte wrote: > > playing with lazytime on 4.0.4-rc1 + yesterday's fencepost patch) I= noticed > > something odd. Mounting secondary (non-root) partitions with lazyti= me works > > fine, but / does not seem to retain the value from fstab - apparent= ly because > > it is remounted rw during boot, and lazytime gets swallowed/undone. > >=20 > > Same effect when trying to remount manually with lazytime: > >=20 > > tux>findmnt / > > TARGET SOURCE FSTYPE OPTIONS > > / /dev/sda1 ext4 rw,noatime > >=20 > > tux>mount -o lazytime,remount /=20 > >=20 > > tux>dmesg=20 > > [ 5208.482505] EXT4-fs (sda1): re-mounted. Opts: (null) > >=20 > > tux>findmnt / =20 > > TARGET SOURCE FSTYPE OPTIONS > > / /dev/sda1 ext4 rw,noatime > >=20 > > tux>mount --version > > mount from util-linux 2.26.2 (libmount 2.26.0: assert, debug) > >=20 > > Newly mounting unmounted partitions works fine. > >=20 > > Any ideas? >=20 > This turned out to be a regression in util-linux 2.26.x. :-( I don't think so. Try strace, for example: # strace -e mount mount -o lazytime,remount /home/archive mount("/dev/sdb1", "/home/archive", 0xcf1210, MS_REMOUNT|0x2000000, NU= LL) =3D 0 ^^^^^^^^^ (1<<25) aka 0x2000000 is MS_LAZYTIME The util-linux since version 2.26.2 supports MS_LAZYTIME flag.=20 =20 I see the problem on another place. The ext4 fs driver has unique feature that it's able to accept "lazytime" option as string (util-linux < 2.26.2) as well as MS_LAZYTIME vfs flag (>=3D 2.26.2). IMHO the function ext4_remount() does not check VFS *flags for MS_LAZYTIME at all. The code probably cares about sb->s_flags only (these flags are generated by parse_options() when parse options string). It seems that only MS_RDONLY is expected in *flags.=20 Ted? Karel --=20 Karel Zak http://karelzak.blogspot.com -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" i= n the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html