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: "Greg A. Woods" <woods%planix.ca@localhost>
To: NetBSD GNATS <gnats-bugs%NetBSD.org@localhost>
Cc: "J. Hannken-Illjes" <hannken%eis.cs.tu-bs.de@localhost>
Subject: Re: kern/54969 (Disk cache is no longer flushed on shutdown)
Date: Tue, 04 May 2021 11:07:42 -0700
--pgp-sign-Multipart_Tue_May__4_11:07:26_2021-1
Content-Type: text/plain; charset=US-ASCII
At Tue, 4 May 2021 11:57:05 +0200, "J. Hannken-Illjes" <hannken%eis.cs.tu-bs.de@localhost> wrote:
Subject: Re: kern/54969 (Disk cache is no longer flushed on shutdown)
>
> 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.
Excellent catch!
> 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 */);
>
I'll give that a try, and I expect it to work -- it looks like this is
indeed the problem!
--
Greg A. Woods <gwoods%acm.org@localhost>
Kelowna, BC +1 250 762-7675 RoboHack <woods%robohack.ca@localhost>
Planix, Inc. <woods%planix.com@localhost> Avoncote Farms <woods%avoncote.ca@localhost>
--pgp-sign-Multipart_Tue_May__4_11:07:26_2021-1
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit
Content-Description: OpenPGP Digital Signature
-----BEGIN PGP SIGNATURE-----
iF0EABECAB0WIQRuK6dmwVAucmRxuh9mfXG3eL/0fwUCYJGNYgAKCRBmfXG3eL/0
f1+iAJ9J/9iTyVnj7ROHe6JN4DeDUMqZzwCdGo4HOCFb+GZk3ai9joRzN8nv5yI=
=b5AY
-----END PGP SIGNATURE-----
--pgp-sign-Multipart_Tue_May__4_11:07:26_2021-1--
Home |
Main Index |
Thread Index |
Old Index