NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/54969 (Disk cache is no longer flushed on shutdown)



The following reply was made to PR kern/54969; it has been noted by GNATS.

From: "J. Hannken-Illjes" <hannken%eis.cs.tu-bs.de@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: "Greg A. Woods" <woods%planix.ca@localhost>
Subject: Re: kern/54969 (Disk cache is no longer flushed on shutdown)
Date: Tue, 4 May 2021 11:57:05 +0200

 --Apple-Mail=_39DD0DB7-6F29-4B35-94E0-A802F5308099
 Content-Transfer-Encoding: quoted-printable
 Content-Type: text/plain;
 	charset=us-ascii
 
 > On 25. Mar 2021, at 19:15, Greg A. Woods <woods%planix.ca@localhost> wrote:
 <snip[>
 > There's no excuse I can find for /build not unmounting though, and
 > definitely no excuse for '/' not umounting either, though it later '/'
 > is forcefully unmounted, and on reboot '/' appears to be clean.  =
 However
 > the forceful unmount of /build doesn't work, and it is NOT clean.
 >=20
 > Note also that /build will sometimes unmount quickly and cleanly if it
 > hasn't been dirtied since the last boot, but it seems even creating =
 one
 > file can leave it dirty on reboot.
 >=20
 > Maybe what remains an issue here is just related to dm(4) partitions?
 <snip>
 > [Wed Mar 24 20:42:58 2021][ 715714.8282434] unmount of /build =
 (/dev/mapper/scratch-build) failed with error 16
 > [Wed Mar 24 20:42:58 2021][ 715714.8282434] unmount of / (/dev/dk0) =
 failed with error 16
 > [Wed Mar 24 20:42:58 2021][ 715714.8282434] WARNING: some file systems =
 would not unmount
 > [Wed Mar 24 20:42:59 2021][ 715716.5383256] brgphy1: detached
 >=20
 > 	[[ ... almost all the rest of devices detach ... ]]
 
 I'm quite sure one of them is "dm0" -- dm(4) is no longer backed with
 physical disks but /build is still mounted so from here on even forced
 unmounts fail.
 
 This problem occurs on dm(4) devices only.
 
 Looking through sys/dev/dm/device-mapper.c it becomes clear that
 dmopen() / dmclose() don't count opens and therefore dm_detach() will
 unconditionally unconfigure dm(4).
 
 As dm_detach() gets called during shutdown dm(4) unconfigures too early.
 
 
 Fix is to count device opens and prevent dm_detach() to succeed as long
 as devices are open.  Once succeeding during shutdown it should
 dm_destroy() on last dm_detach().
 
 
 Short term hack is to remove DVF_DETACH_SHUTDOWN from device_mapper.c
 so dm_detach() doesn't run on shutdown:
 
  CFATTACH_DECL3_NEW(dm, 0,
       dm_match, dm_attach, dm_detach, NULL, NULL, NULL,
 -     DVF_DETACH_SHUTDOWN);
 +     0 /* DVF_DETACH_SHUTDOWN */);
 
 --
 J. Hannken-Illjes - hannken%eis.cs.tu-bs.de@localhost - TU Braunschweig (Germany)
 
 --Apple-Mail=_39DD0DB7-6F29-4B35-94E0-A802F5308099
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename=signature.asc
 Content-Type: application/pgp-signature;
 	name=signature.asc
 Content-Description: Message signed with OpenPGP
 
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAEBCAAdFiEE2BL3ha7Xao4WUZVYKoaVJdNr+uEFAmCRGnEACgkQKoaVJdNr
 +uGdhQf9G5TZ2vOVej7RK63LlRSn/8CPo1uY7U1mAqwkhY1N5/M6z8qLqSEUbZFL
 tUIWvtNhhNqshSzkGzaQd767UxpajZv7PK4oBUsM+UWrRlDcAZbQ5PxF3Eme5wnu
 Z34xrp5/D/L8JLH0XM1uKN8SuBEbA3jCyOsD56ud8+vUs+xheSMARTZM+/LGFdCC
 hz7hsEgtIzwGgVAYDtCEcBB7+b+WKInOJ/+TigCaPR322Izo8kD1OmMgPIQUB5Sz
 DQoRjYSph33A4CdDfz2Rd/yWZ+9It+O5/pY9XYJhkLKZsf00a++qYg3ssjkm5Wye
 4q2mV44ljoZ4ye9zBiPsXsjPfJzJag==
 =GkNU
 -----END PGP SIGNATURE-----
 
 --Apple-Mail=_39DD0DB7-6F29-4B35-94E0-A802F5308099--
 


Home | Main Index | Thread Index | Old Index