linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* nolazytime remount
@ 2015-08-19  8:21 Karel Zak
  2015-08-19 14:15 ` tytso
  0 siblings, 1 reply; 3+ messages in thread
From: Karel Zak @ 2015-08-19  8:21 UTC (permalink / raw)
  To: linux-ext4; +Cc: Theodore Ts'o


We had issue with "lazytime" remount two mouths ago. This is already
fixed by Ted's patch a2fd66d06. So, now you can enable lazytime by
remount with MS_LAZYTIME flag, but how I can disable lazytime?

enable lazytime (works as expected):

 # findmnt /mnt/test
 TARGET    SOURCE    FSTYPE OPTIONS
 /mnt/test /dev/sdc1 ext4   rw,relatime,stripe=32,data=ordered

 # mount -o remount,lazytime /mnt/test

 # findmnt /mnt/test
 TARGET    SOURCE    FSTYPE OPTIONS
 /mnt/test /dev/sdc1 ext4   rw,relatime,lazytime,stripe=32,data=ordered


disable lazytime by "nolazytime":

 # mount -o remount,nolazytime /mnt/test
 # findmnt /mnt/test
 TARGET    SOURCE    FSTYPE OPTIONS
 /mnt/test /dev/sdc1 ext4   rw,relatime,lazytime,stripe=32,data=ordered
                                        ^^^^^^^^

In this case mount(8) command generates:
  mount("/dev/sdc1", "/mnt/test", 0x562ed2f7e210, MS_REMOUNT|MS_RELATIME, "stripe=32,data=ordered") = 0
syscall.


It seems that ext4_remount() allows to enable the option by MS_LAZYTIME,
but there is no sb->s_flags &= ~MS_LAZYTIME at all. It seems like a
regression, because old string based solution (handle_mount_opt()) contains:

  case Opt_nolazytime:
       sb->s_flags &= ~MS_LAZYTIME;
       return 1;


>From my point of view, a2fd66d06 commit is insufficient, for ext4_remount()
we also need "else" for MS_LAZYTIME:

	if (*flags & MS_LAZYTIME)
		sb->s_flags |= MS_LAZYTIME;
    else
        sb->s_flags &= ~MS_LAZYTIME;


The another possibility is that "lazytime" is possible enable only --
if yes, then handle_mount_opt() should be fixed to not provide
Opt_nolazytime.

Ted?

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-24  9:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-19  8:21 nolazytime remount Karel Zak
2015-08-19 14:15 ` tytso
2015-08-24  9:29   ` Karel Zak

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).