* Lazytime undone by/not working with remount?
@ 2015-05-16 11:05 Holger Hoffstätte
2015-05-16 14:26 ` Holger Hoffstätte
[not found] ` <55575399.6010801@googlemail.com>
0 siblings, 2 replies; 7+ messages in thread
From: Holger Hoffstätte @ 2015-05-16 11:05 UTC (permalink / raw)
To: linux-ext4
Hi,
playing with lazytime on 4.0.4-rc1 + yesterday's fencepost patch) I noticed
something odd. Mounting secondary (non-root) partitions with lazytime works
fine, but / does not seem to retain the value from fstab - apparently because
it is remounted rw during boot, and lazytime gets swallowed/undone.
Same effect when trying to remount manually with lazytime:
tux>findmnt /
TARGET SOURCE FSTYPE OPTIONS
/ /dev/sda1 ext4 rw,noatime
tux>mount -o lazytime,remount /
tux>dmesg
[ 5208.482505] EXT4-fs (sda1): re-mounted. Opts: (null)
tux>findmnt /
TARGET SOURCE FSTYPE OPTIONS
/ /dev/sda1 ext4 rw,noatime
tux>mount --version
mount from util-linux 2.26.2 (libmount 2.26.0: assert, debug)
Newly mounting unmounted partitions works fine.
Any ideas?
Holger
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: Lazytime undone by/not working with remount? 2015-05-16 11:05 Lazytime undone by/not working with remount? Holger Hoffstätte @ 2015-05-16 14:26 ` Holger Hoffstätte [not found] ` <55575399.6010801@googlemail.com> 1 sibling, 0 replies; 7+ messages in thread From: Holger Hoffstätte @ 2015-05-16 14:26 UTC (permalink / raw) To: linux-ext4 (cc: kzak) On Sat, 16 May 2015 11:05:04 +0000, Holger Hoffstätte wrote: > Hi, > > playing with lazytime on 4.0.4-rc1 + yesterday's fencepost patch) I noticed > something odd. Mounting secondary (non-root) partitions with lazytime works > fine, but / does not seem to retain the value from fstab - apparently because > it is remounted rw during boot, and lazytime gets swallowed/undone. > > Same effect when trying to remount manually with lazytime: > > tux>findmnt / > TARGET SOURCE FSTYPE OPTIONS > / /dev/sda1 ext4 rw,noatime > > tux>mount -o lazytime,remount / > > tux>dmesg > [ 5208.482505] EXT4-fs (sda1): re-mounted. Opts: (null) > > tux>findmnt / > TARGET SOURCE FSTYPE OPTIONS > / /dev/sda1 ext4 rw,noatime > > tux>mount --version > mount from util-linux 2.26.2 (libmount 2.26.0: assert, debug) > > Newly mounting unmounted partitions works fine. > > Any ideas? This turned out to be a regression in util-linux 2.26.x. :-( I downgraded to 2.25.2 and behold: tux>findmnt / TARGET SOURCE FSTYPE OPTIONS / /dev/sda1 ext4 rw,noatime tux>mount -o remount,lazytime / root>findmnt / TARGET SOURCE FSTYPE OPTIONS / /dev/sda1 ext4 rw,noatime,lazytime Sorry for the noise. Holger -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <55575399.6010801@googlemail.com>]
* Re: Lazytime undone by/not working with remount? [not found] ` <55575399.6010801@googlemail.com> @ 2015-05-18 8:21 ` Karel Zak 2015-05-18 15:18 ` Eric Sandeen 2015-05-18 15:23 ` Theodore Ts'o 0 siblings, 2 replies; 7+ messages in thread From: Karel Zak @ 2015-05-18 8:21 UTC (permalink / raw) To: Holger Hoffstätte; +Cc: linux-ext4, Theodore Ts'o On Sat, May 16, 2015 at 04:26:33PM +0200, Holger Hoffstätte wrote: > > playing with lazytime on 4.0.4-rc1 + yesterday's fencepost patch) I noticed > > something odd. Mounting secondary (non-root) partitions with lazytime works > > fine, but / does not seem to retain the value from fstab - apparently because > > it is remounted rw during boot, and lazytime gets swallowed/undone. > > > > Same effect when trying to remount manually with lazytime: > > > > tux>findmnt / > > TARGET SOURCE FSTYPE OPTIONS > > / /dev/sda1 ext4 rw,noatime > > > > tux>mount -o lazytime,remount / > > > > tux>dmesg > > [ 5208.482505] EXT4-fs (sda1): re-mounted. Opts: (null) > > > > tux>findmnt / > > TARGET SOURCE FSTYPE OPTIONS > > / /dev/sda1 ext4 rw,noatime > > > > tux>mount --version > > mount from util-linux 2.26.2 (libmount 2.26.0: assert, debug) > > > > Newly mounting unmounted partitions works fine. > > > > Any ideas? > > 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, NULL) = 0 ^^^^^^^^^ (1<<25) aka 0x2000000 is MS_LAZYTIME The util-linux since version 2.26.2 supports MS_LAZYTIME flag. 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 (>= 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. Ted? Karel -- Karel Zak <kzak@redhat.com> http://karelzak.blogspot.com -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Lazytime undone by/not working with remount? 2015-05-18 8:21 ` Karel Zak @ 2015-05-18 15:18 ` Eric Sandeen 2015-05-18 15:36 ` Holger Hoffstätte 2015-05-18 15:23 ` Theodore Ts'o 1 sibling, 1 reply; 7+ messages in thread From: Eric Sandeen @ 2015-05-18 15:18 UTC (permalink / raw) To: Karel Zak, Holger Hoffstätte; +Cc: linux-ext4, Theodore Ts'o On 5/18/15 3:21 AM, Karel Zak wrote: > On Sat, May 16, 2015 at 04:26:33PM +0200, Holger Hoffstätte wrote: >>> playing with lazytime on 4.0.4-rc1 + yesterday's fencepost patch) I noticed >>> something odd. Mounting secondary (non-root) partitions with lazytime works >>> fine, but / does not seem to retain the value from fstab - apparently because >>> it is remounted rw during boot, and lazytime gets swallowed/undone. >>> >>> Same effect when trying to remount manually with lazytime: >>> >>> tux>findmnt / >>> TARGET SOURCE FSTYPE OPTIONS >>> / /dev/sda1 ext4 rw,noatime >>> >>> tux>mount -o lazytime,remount / >>> >>> tux>dmesg >>> [ 5208.482505] EXT4-fs (sda1): re-mounted. Opts: (null) >>> >>> tux>findmnt / >>> TARGET SOURCE FSTYPE OPTIONS >>> / /dev/sda1 ext4 rw,noatime >>> >>> tux>mount --version >>> mount from util-linux 2.26.2 (libmount 2.26.0: assert, debug) And what does /proc/mounts say? That'll tell you what is actually set on the superblock. Works here, on 4.1.0-rc2: # mount /dev/sdb1 /mnt/test # mount -o remount,lazytime /mnt/test # grep sdb1 /proc/mounts /dev/sdb1 /mnt/test ext4 rw,lazytime,seclabel,relatime,data=ordered 0 0 # dmesg | tail -n 2 [516203.450943] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null) [516211.222020] EXT4-fs (sdb1): re-mounted. Opts: lazytime -Eric -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Lazytime undone by/not working with remount? 2015-05-18 15:18 ` Eric Sandeen @ 2015-05-18 15:36 ` Holger Hoffstätte 0 siblings, 0 replies; 7+ messages in thread From: Holger Hoffstätte @ 2015-05-18 15:36 UTC (permalink / raw) To: Eric Sandeen, Karel Zak; +Cc: linux-ext4, Theodore Ts'o On 05/18/15 17:18, Eric Sandeen wrote: > On 5/18/15 3:21 AM, Karel Zak wrote: >> On Sat, May 16, 2015 at 04:26:33PM +0200, Holger Hoffstätte wrote: >>>> playing with lazytime on 4.0.4-rc1 + yesterday's fencepost patch) I noticed >>>> something odd. Mounting secondary (non-root) partitions with lazytime works >>>> fine, but / does not seem to retain the value from fstab - apparently because >>>> it is remounted rw during boot, and lazytime gets swallowed/undone. >>>> >>>> Same effect when trying to remount manually with lazytime: >>>> >>>> tux>findmnt / >>>> TARGET SOURCE FSTYPE OPTIONS >>>> / /dev/sda1 ext4 rw,noatime >>>> >>>> tux>mount -o lazytime,remount / >>>> >>>> tux>dmesg >>>> [ 5208.482505] EXT4-fs (sda1): re-mounted. Opts: (null) >>>> >>>> tux>findmnt / >>>> TARGET SOURCE FSTYPE OPTIONS >>>> / /dev/sda1 ext4 rw,noatime >>>> >>>> tux>mount --version >>>> mount from util-linux 2.26.2 (libmount 2.26.0: assert, debug) > > And what does /proc/mounts say? That'll tell you what is actually set > on the superblock. Works here, on 4.1.0-rc2: > > # mount /dev/sdb1 /mnt/test > # mount -o remount,lazytime /mnt/test > # grep sdb1 /proc/mounts > /dev/sdb1 /mnt/test ext4 rw,lazytime,seclabel,relatime,data=ordered 0 0 > > # dmesg | tail -n 2 > [516203.450943] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null) > [516211.222020] EXT4-fs (sdb1): re-mounted. Opts: lazytime When I used util-linux 2.26.2 /proc/mounts never contained lazytime for the root device (sda1), despite the fact that it and other partitions explicitly had lazytime in fstab. Secondary drives & partitions *did* get the value right from the start, i.e. anything that didn't go through a ro->remount transition. It all works reliably with 2.25.x since - as Karel mentioned - the bug seems with ext4's remount logic in combination with readonly (as was the case with the root partition) and mount now actually sending the MS_LAZYTIME flag, instead of relying on ext4's builtin extra handling. -h -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Lazytime undone by/not working with remount? 2015-05-18 8:21 ` Karel Zak 2015-05-18 15:18 ` Eric Sandeen @ 2015-05-18 15:23 ` Theodore Ts'o 2015-05-18 15:38 ` Holger Hoffstätte 1 sibling, 1 reply; 7+ messages in thread From: Theodore Ts'o @ 2015-05-18 15:23 UTC (permalink / raw) To: Karel Zak; +Cc: Holger Hoffstätte, linux-ext4 On Mon, May 18, 2015 at 10:21:35AM +0200, Karel Zak wrote: > 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 (>= 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. Yep, the bug is on my side, in ext4_remount(). I'll get this fixed and marked as something that should get bacported to the stable tree. My apologies for the oversight. - Ted ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Lazytime undone by/not working with remount? 2015-05-18 15:23 ` Theodore Ts'o @ 2015-05-18 15:38 ` Holger Hoffstätte 0 siblings, 0 replies; 7+ messages in thread From: Holger Hoffstätte @ 2015-05-18 15:38 UTC (permalink / raw) To: Theodore Ts'o, Karel Zak; +Cc: linux-ext4 On 05/18/15 17:23, Theodore Ts'o wrote: > On Mon, May 18, 2015 at 10:21:35AM +0200, Karel Zak wrote: >> 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 (>= 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. > > Yep, the bug is on my side, in ext4_remount(). I'll get this fixed > and marked as something that should get bacported to the stable tree. > My apologies for the oversight. Thanks for confirming, Ted! I'll gladly test a patch for 4.0.x. -h ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-05-18 15:48 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-16 11:05 Lazytime undone by/not working with remount? Holger Hoffstätte
2015-05-16 14:26 ` Holger Hoffstätte
[not found] ` <55575399.6010801@googlemail.com>
2015-05-18 8:21 ` Karel Zak
2015-05-18 15:18 ` Eric Sandeen
2015-05-18 15:36 ` Holger Hoffstätte
2015-05-18 15:23 ` Theodore Ts'o
2015-05-18 15:38 ` Holger Hoffstätte
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).