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" <>
Cc: "J. Hannken-Illjes" <>
Subject: Re: kern/54969 (Disk cache is no longer flushed on shutdown)
Date: Tue, 04 May 2021 11:07:42 -0700

 Content-Type: text/plain; charset=US-ASCII
 At Tue, 4 May 2021 11:57:05 +0200, "J. Hannken-Illjes" <> 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,
 > + 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 <>
 Kelowna, BC     +1 250 762-7675           RoboHack <>
 Planix, Inc. <>     Avoncote Farms <>
 Content-Type: application/pgp-signature
 Content-Transfer-Encoding: 7bit
 Content-Description: OpenPGP Digital Signature

Home | Main Index | Thread Index | Old Index