FreeBSD Bugzilla – Attachment 185303 Details for
Bug 211852
Unsafe shutdowns on Intel 750 SSD
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to resolve issue
nvmeshutdown.diff (text/plain), 1.27 KB, created by
Nathan Whitehorn
on 2017-08-12 05:25:31 UTC
(
hide
)
Description:
Patch to resolve issue
Filename:
MIME Type:
Creator:
Nathan Whitehorn
Created:
2017-08-12 05:25:31 UTC
Size:
1.27 KB
patch
obsolete
>Index: sys/dev/nvme/nvme.c >=================================================================== >--- sys/dev/nvme/nvme.c (revision 322421) >+++ sys/dev/nvme/nvme.c (working copy) >@@ -58,6 +58,7 @@ > static int nvme_probe(device_t); > static int nvme_attach(device_t); > static int nvme_detach(device_t); >+static int nvme_shutdown(device_t); > static int nvme_modevent(module_t mod, int type, void *arg); > > static devclass_t nvme_devclass; >@@ -67,6 +68,7 @@ > DEVMETHOD(device_probe, nvme_probe), > DEVMETHOD(device_attach, nvme_attach), > DEVMETHOD(device_detach, nvme_detach), >+ DEVMETHOD(device_shutdown, nvme_shutdown), > { 0, 0 } > }; > >@@ -179,22 +181,15 @@ > { > } > >-static void >-nvme_shutdown(void) >+static int >+nvme_shutdown(device_t dev) > { >- device_t *devlist; > struct nvme_controller *ctrlr; >- int dev, devcount; > >- if (devclass_get_devices(nvme_devclass, &devlist, &devcount)) >- return; >+ ctrlr = DEVICE2SOFTC(dev); >+ nvme_ctrlr_shutdown(ctrlr); > >- for (dev = 0; dev < devcount; dev++) { >- ctrlr = DEVICE2SOFTC(devlist[dev]); >- nvme_ctrlr_shutdown(ctrlr); >- } >- >- free(devlist, M_TEMP); >+ return (0); > } > > static int >@@ -208,9 +203,6 @@ > case MOD_UNLOAD: > nvme_unload(); > break; >- case MOD_SHUTDOWN: >- nvme_shutdown(); >- break; > default: > break; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 211852
: 185303