[Bug 223786] Remounting a UFS filesystem read-only takes very long time

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Nov 21 17:08:16 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223786

            Bug ID: 223786
           Summary: Remounting a UFS filesystem read-only takes very long
                    time
           Product: Base System
           Version: 10.4-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Keywords: regression
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: mi at ALDAN.algebra.com

I usually keep my / mounted read-only -- mostly for safety. When I need to
change some aspect of configuration or add a port, I remount rw, do what needs
doing, and then remount back to read-only mode.

This worked for me for many years, but lately I noticed, the remounting back to
the ro-mode is taking longer than it used to. Many seconds, especially, when it
was active shortly before the remount command.

Today, however, with the freshly rebuilt kernel (FreeBSD 10.4-STABLE #15
r325999M), it takes well over a minute! A minute, during which the machine
largely freezes -- for example, making new logins impossible.

I understand the need to flush the unwritten to disk, when switching to ro, but
just how much should that take in the scenario I just had:

  1048  11:56   mount -orw -u /
  1049  11:56   chmod u+s /opt/cyrus/bin/deliver
  1050  11:56   mount -oro -u /

? The second remount took well over minute and it seems wrong.

The filesystem is based on SSD and looks like:

  /dev/ada0s1a on / (ufs, NFS exported, local, read-only)

`tunefs -p /` reports:

tunefs: POSIX.1e ACLs: (-a)                                disabled
tunefs: NFSv4 ACLs: (-N)                                   disabled
tunefs: MAC multilabel: (-l)                               disabled
tunefs: soft updates: (-n)                                 enabled
tunefs: soft update journaling: (-j)                       disabled
tunefs: gjournal: (-J)                                     disabled
tunefs: trim: (-t)                                         enabled
tunefs: maximum blocks per file in a cylinder group: (-e)  1048576
tunefs: average file size: (-f)                            16384
tunefs: average number of files in a directory: (-s)       64
tunefs: minimum percentage of free space: (-m)             8%
tunefs: space to hold for metadata blocks: (-k)            0
tunefs: optimization preference: (-o)                      time
tunefs: volume label: (-L)

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list