* [PATCH] VFS: Handle lazytime in do_mount()
@ 2017-10-11 5:01 Markus Trippelsdorf
2017-11-17 12:09 ` Goldwyn Rodrigues
0 siblings, 1 reply; 3+ messages in thread
From: Markus Trippelsdorf @ 2017-10-11 5:01 UTC (permalink / raw)
To: Alexander Viro
Cc: Andreas Dilger, linux-ext4, Theodore Ts'o, linux-fsdevel,
linux-kernel, David Howells, Lukas Czerner
Since commit e462ec50cb5fa ("VFS: Differentiate mount flags (MS_*) from
internal superblock flags") the lazytime mount option doesn't get passed
on anymore.
Fix the issue by handling the option in do_mount().
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de>
---
fs/namespace.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/namespace.c b/fs/namespace.c
index 54059b142d6b..b633838b8f02 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2823,7 +2823,8 @@ long do_mount(const char *dev_name, const char __user *dir_name,
SB_MANDLOCK |
SB_DIRSYNC |
SB_SILENT |
- SB_POSIXACL);
+ SB_POSIXACL |
+ SB_LAZYTIME);
if (flags & MS_REMOUNT)
retval = do_remount(&path, flags, sb_flags, mnt_flags,
--
Markus
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] VFS: Handle lazytime in do_mount() 2017-10-11 5:01 [PATCH] VFS: Handle lazytime in do_mount() Markus Trippelsdorf @ 2017-11-17 12:09 ` Goldwyn Rodrigues 0 siblings, 0 replies; 3+ messages in thread From: Goldwyn Rodrigues @ 2017-11-17 12:09 UTC (permalink / raw) To: Markus Trippelsdorf, Alexander Viro Cc: Andreas Dilger, linux-ext4, Theodore Ts'o, linux-fsdevel, linux-kernel, David Howells, Lukas Czerner On 10/11/2017 12:01 AM, Markus Trippelsdorf wrote: > Since commit e462ec50cb5fa ("VFS: Differentiate mount flags (MS_*) from > internal superblock flags") the lazytime mount option doesn't get passed > on anymore. > > Fix the issue by handling the option in do_mount(). > > Reviewed-by: Lukas Czerner <lczerner@redhat.com> > Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de> Reviewed-by: Goldwyn Rodrigues <rgoldwyn@suse.com> > --- > fs/namespace.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/fs/namespace.c b/fs/namespace.c > index 54059b142d6b..b633838b8f02 100644 > --- a/fs/namespace.c > +++ b/fs/namespace.c > @@ -2823,7 +2823,8 @@ long do_mount(const char *dev_name, const char __user *dir_name, > SB_MANDLOCK | > SB_DIRSYNC | > SB_SILENT | > - SB_POSIXACL); > + SB_POSIXACL | > + SB_LAZYTIME); > > if (flags & MS_REMOUNT) > retval = do_remount(&path, flags, sb_flags, mnt_flags, > -- Goldwyn ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <20170918192644.GA232@x4>]
* Re: mounting with lazytime doesn't work on ext4 [not found] <20170918192644.GA232@x4> @ 2017-09-19 8:35 ` Markus Trippelsdorf 2017-09-19 10:18 ` [PATCH] VFS: Handle lazytime in do_mount() Markus Trippelsdorf 0 siblings, 1 reply; 3+ messages in thread From: Markus Trippelsdorf @ 2017-09-19 8:35 UTC (permalink / raw) To: Theodore Ts'o Cc: Andreas Dilger, linux-ext4, Alexander Viro, linux-fsdevel On 2017.09.18 at 21:26 +0200, Markus Trippelsdorf wrote: > I switched back to ext4 yesterday, because my btrfs fs got corrupted. > However mounting with lazytime doesn't work, neither specifying it in > /etc/fstab nor a manual remount. It looks like the option is simply > ignored. > > Strace shows, e.g.: > > # mount -o lazytime /boot > mount("/dev/sdc2", "/boot", "ext4", MS_LAZYTIME, NULL) = 0 > EXT4-fs (sdc2): mounted filesystem with ordered data mode. Opts: (null) > /dev/sdc2 on /boot type ext4 (rw,relatime,data=ordered) > > # mount -o remount,lazytime /var > mount("/dev/sdb2", "/var", 0x12c4460, MS_REMOUNT|MS_NOATIME|MS_LAZYTIME, NULL) = 0 > EXT4-fs (sdb2): re-mounted. Opts: (null) > /dev/sdb2 on /var type ext4 (rw,noatime,data=ordered) > > When I set "sb->s_flags |= MS_LAZYTIME;" unconditionally in > fs/ext4/super.c:5057 (just deleting the if statement), then lazytime > gets used when I remount. > > I'm running the latest git tree (4.14.0-rc1). The following patch seems to fix the issue for remounts: diff --git a/fs/namespace.c b/fs/namespace.c index 54059b142d6b..d0b386706c5b 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -2322,6 +2322,9 @@ static int do_remount(struct path *path, int ms_flags, int sb_flags, if (err) return err; + if (mnt_flags & MS_LAZYTIME) + sb_flags |= MS_LAZYTIME; + down_write(&sb->s_umount); if (ms_flags & MS_BIND) err = change_mount_flags(path->mnt, ms_flags); @@ -2809,6 +2812,8 @@ long do_mount(const char *dev_name, const char __user *dir_name, mnt_flags &= ~(MNT_RELATIME | MNT_NOATIME); if (flags & SB_RDONLY) mnt_flags |= MNT_READONLY; + if (flags & MS_LAZYTIME) + mnt_flags |= MS_LAZYTIME; /* The default atime for remount is preservation */ if ((flags & MS_REMOUNT) && -- Markus ^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] VFS: Handle lazytime in do_mount() 2017-09-19 8:35 ` mounting with lazytime doesn't work on ext4 Markus Trippelsdorf @ 2017-09-19 10:18 ` Markus Trippelsdorf 0 siblings, 0 replies; 3+ messages in thread From: Markus Trippelsdorf @ 2017-09-19 10:18 UTC (permalink / raw) To: Theodore Ts'o Cc: Andreas Dilger, linux-ext4, Alexander Viro, linux-fsdevel, linux-kernel The lazytime option didn't get passed on when using current util-linux, which passes MS_LAZYTIME in the mountflags directly. Fix the issue by handling the option in do_mount(). Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de> --- fs/namespace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/namespace.c b/fs/namespace.c index 54059b142d6b..b633838b8f02 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -2823,7 +2823,8 @@ long do_mount(const char *dev_name, const char __user *dir_name, SB_MANDLOCK | SB_DIRSYNC | SB_SILENT | - SB_POSIXACL); + SB_POSIXACL | + MS_LAZYTIME); if (flags & MS_REMOUNT) retval = do_remount(&path, flags, sb_flags, mnt_flags, -- Markus ^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-11-17 12:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-11 5:01 [PATCH] VFS: Handle lazytime in do_mount() Markus Trippelsdorf
2017-11-17 12:09 ` Goldwyn Rodrigues
[not found] <20170918192644.GA232@x4>
2017-09-19 8:35 ` mounting with lazytime doesn't work on ext4 Markus Trippelsdorf
2017-09-19 10:18 ` [PATCH] VFS: Handle lazytime in do_mount() Markus Trippelsdorf
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).