[Bug 297342] Not unmounted root nullfs after jail stop

[email protected]
Newsgroups gmane.os.freebsd.bugs
Message-ID <[email protected]/bugzilla/>
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297342

            Bug ID: 297342
           Summary: Not unmounted root nullfs after jail stop
           Product: Base System
           Version: 15.0-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 273535
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=273535&action=edit
debug output of failed umount

From time to time, and the more uptime, the more likely it is to encounter an
error

After stopping a jail configured with mount.fstab containing a nullfs mount
used as the jail root (path), umount(8) immediately fails with EBUSY.

The jail is already removed (jls is empty), fstat and procstat show no
references, and there are no nested mounts.

Executing sync(8) makes the subsequent umount(8) succeed without any other
changes.

The behavior is reproducible on FreeBSD 15.0-RELEASE-p12.

steps to reproduce:
$ service jail stop samba
Stopping jails: samba.
$ jls | grep samba
$ mount -v |grep samba
/usr/local/jails/templates/15-RELEASE-base on /usr/local/jails/runFS/samba
(nullfs, local, read-only, fsid 5dff002929000000, vnodes: count 1 )
$ ktrace umount /usr/local/jails/runFS/samba
umount: unmount of /usr/local/jails/runFS/samba failed: Device busy
$ kdump >/tmp/d_busy
-- wait 2-3 sec
$ sync
$ ktrace umount /usr/local/jails/runFS/samba
umount: unmount of /usr/local/jails/runFS/samba failed: Device busy
-- wait 2-3 sec
$ sync
$ sync
$ sync
$ ktrace umount /usr/local/jails/runFS/samba
umount: unmount of /usr/local/jails/runFS/samba failed: Device busy
-- wait 2-3 sec
$ ktrace umount /usr/local/jails/runFS/samba
umount: unmount of /usr/local/jails/runFS/samba failed: Device busy
-- wait 2-3 sec
$ ktrace umount /usr/local/jails/runFS/samba
$ kdump >/tmp/d_ok

configs:
$ cat /etc/jail.conf.d/samba.conf
samba {
  # STARTUP/LOGGING
  exec.start = "/bin/sh /etc/rc";
  exec.stop = "/bin/sh /etc/rc.shutdown";
  exec.consolelog = "/var/log/jail_console_${name}.log";

  # PERMISSIONS
  allow.raw_sockets;
  exec.clean;
  mount.devfs;
  devfs_ruleset = 4;
  enforce_statfs = 1;
  allow.mount;
  allow.mount.fdescfs;

  # HOSTNAME/PATH
  host.hostname = "${name}";
  path = "/usr/local/jails/runFS/${name}";

  # NETWORK
  ip4 = inherit;
  interface = vtnet0;

  # MOUNT
  mount.fstab = "/usr/local/jails/runFS/${name}.fstab";
}
$ cat /usr/local/jails/runFS/samba.fstab
# Device                                        Mountpoint                     
                                FStype  Options Dump    Pass#
/usr/local/jails/templates/15-RELEASE-base      /usr/local/jails/runFS/samba/  
                                nullfs  ro      0       0
/usr/local/jails/containers/samba              
/usr/local/jails/runFS/samba/skeleton                           nullfs  rw     
0       0

-- 
You are receiving this mail because:
You are the assignee for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.