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: Andreas Gustafsson <gson%gson.org@localhost>
Subject: Re: kern/54969: Disk cache is no longer flushed on shutdown
Date: Wed, 19 Feb 2020 14:31:20 +0100

 --Apple-Mail=_092968F0-61F9-472B-9D3A-FC2BA4D40A76
 Content-Type: multipart/mixed;
 	boundary="Apple-Mail=_CA4E0C13-7F83-4B6E-9110-F0183169C8C4"
 
 
 --Apple-Mail=_CA4E0C13-7F83-4B6E-9110-F0183169C8C4
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain;
 	charset=us-ascii
 
 Tried with sd0@vioscsi0 under qemu with some printfs and got:
 
 $ shutdown -p now
 ...
 unmounting 0xffff9d635e36a008 / (/dev/sd0a)...
 forcefully unmounting / (/dev/sd0a)...
 sdclose: dev=0x400 (unit 0)
 dk_close: dev=0x400 error=0 openmask=c0 b0
 sd0: detached
 scsibus0: detached
 
 With "halt -p" I see the problem from this PR as the swap
 device sd0b doesn't get closed.
 
 Please report with the attached diff holding the printfs ...
 
 --
 J. Hannken-Illjes - hannken%eis.cs.tu-bs.de@localhost - TU Braunschweig
 
 --Apple-Mail=_CA4E0C13-7F83-4B6E-9110-F0183169C8C4
 Content-Disposition: attachment;
 	filename=sd.c.diff
 Content-Type: application/octet-stream;
 	x-unix-mode=0644;
 	name="sd.c.diff"
 Content-Transfer-Encoding: 7bit
 
 diff -r 9cba3dc7e065 sys/dev/scsipi/sd.c
 --- sys/dev/scsipi/sd.c	Wed Feb 19 09:01:50 2020 +0100
 +++ sys/dev/scsipi/sd.c	Wed Feb 19 14:29:59 2020 +0100
 @@ -520,6 +520,7 @@ sdopen(dev_t dev, int flag, int fmt, str
  		return (ENXIO);
  	dksc = &sd->sc_dksc;
  
 +printf("sdopen: dev=0x%"PRIx64" (unit %d)\n", dev, SDUNIT(dev));
  	if (!device_is_active(dksc->sc_dev))
  		return (ENODEV);
  
 @@ -541,6 +542,7 @@ sdopen(dev_t dev, int flag, int fmt, str
  	}
  
  	error = dk_open(dksc, dev, flag, fmt, l);
 +printf("dk_open: dev=0x%"PRIx64" error=%d openmask=c%x b%x\n", dev, error, dksc->sc_dkdev.dk_copenmask, dksc->sc_dkdev.dk_bopenmask);
  
  	SC_DEBUG(periph, SCSIPI_DB3, ("open complete\n"));
  
 @@ -598,11 +600,14 @@ sdclose(dev_t dev, int flag, int fmt, st
  	struct dk_softc *dksc;
  	int unit;
  
 +printf("sdclose: dev=0x%"PRIx64" (unit %d)\n", dev, SDUNIT(dev));
  	unit = SDUNIT(dev);
  	sd = device_lookup_private(&sd_cd, unit);
  	dksc = &sd->sc_dksc;
  
 -	return dk_close(dksc, dev, flag, fmt, l);
 +	int error = dk_close(dksc, dev, flag, fmt, l);
 +printf("dk_close: dev=0x%"PRIx64" error=%d openmask=c%x b%x\n", dev, error, dksc->sc_dkdev.dk_copenmask, dksc->sc_dkdev.dk_bopenmask);
 +	return error;
  }
  
  /*
 
 --Apple-Mail=_CA4E0C13-7F83-4B6E-9110-F0183169C8C4--
 
 --Apple-Mail=_092968F0-61F9-472B-9D3A-FC2BA4D40A76
 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+uEFAl5NOKgACgkQKoaVJdNr
 +uHFjAgAgKXsB9TWKa+32dENULm4zVK1ar/r5VwQf8bIiAzw2oc3mZRdvjy1KKyA
 9mpTHv/ihduKvwe8M0nkx3rq5L5s9m3Sqh5ohV9IwCw2r2uNn495Ymm3xwz5nYBX
 qNRqM42L8Nv61Tl2herVBhI7YABGO4a7meWF9AW5lUr52bkAhMGmj+k0F+kjRiyc
 Igc+Wwz5hTGNEmOkLNv2N9MwBqephFP/GtCKBxeEEs9iaJf6GonDxELh9EFzbyWE
 +olt8SvojQEfd/+HyEDphK2dVF0wpbaRn5yl2V9FZELv4JNTfILM+HQlkpXprWbj
 OUQXemo5rXRrHfci0rw+gtfsntH0dA==
 =2jGX
 -----END PGP SIGNATURE-----
 
 --Apple-Mail=_092968F0-61F9-472B-9D3A-FC2BA4D40A76--
 


Home | Main Index | Thread Index | Old Index