summaryrefslogtreecommitdiffstats
path: root/sys/dev/mlx
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1999-10-16 03:21:20 +0000
committermsmith <msmith@FreeBSD.org>1999-10-16 03:21:20 +0000
commit47309d882e7f1aa1fb6789d83d3015e6ce80c090 (patch)
tree98e5848a5da6cb709a02570525e9c7ac13555b3c /sys/dev/mlx
parent042c659c00baf041900355f7ac9b17e822b0de85 (diff)
downloadFreeBSD-src-47309d882e7f1aa1fb6789d83d3015e6ce80c090.zip
FreeBSD-src-47309d882e7f1aa1fb6789d83d3015e6ce80c090.tar.gz
Use a much larger buffer for message log retrieval until we are sure that
32 bytes is safe. Handle successful completion of message log retrieval commands. With these changes, the driver correctly handles the consequences of drive death and replacement in a reliable array. Note that the massive backlog of I/O during handling of such an event can kill the system if softupdates is enabled.
Diffstat (limited to 'sys/dev/mlx')
-rw-r--r--sys/dev/mlx/mlx.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/sys/dev/mlx/mlx.c b/sys/dev/mlx/mlx.c
index 6b4e30d..94376f8 100644
--- a/sys/dev/mlx/mlx.c
+++ b/sys/dev/mlx/mlx.c
@@ -1103,7 +1103,7 @@ mlx_periodic_eventlog_poll(struct mlx_softc *sc)
if ((mc = mlx_alloccmd(sc)) == NULL)
goto out;
/* allocate the response structure */
- if ((result = malloc(sizeof(struct mlx_eventlog_entry), M_DEVBUF, M_NOWAIT)) == NULL)
+ if ((result = malloc(/*sizeof(struct mlx_eventlog_entry)*/1024, M_DEVBUF, M_NOWAIT)) == NULL)
goto out;
/* get a command slot */
if (mlx_getslot(mc))
@@ -1111,7 +1111,7 @@ mlx_periodic_eventlog_poll(struct mlx_softc *sc)
/* map the command so the controller can see it */
mc->mc_data = result;
- mc->mc_length = sizeof(struct mlx_eventlog_entry);
+ mc->mc_length = /*sizeof(struct mlx_eventlog_entry)*/1024;
mlx_mapcmd(mc);
/* build the command to get one entry */
@@ -1125,14 +1125,14 @@ mlx_periodic_eventlog_poll(struct mlx_softc *sc)
error = 0; /* success */
out:
- if (mc != NULL)
- mlx_releasecmd(mc);
- if ((error != 0) && (result != NULL)) {
- free(result, M_DEVBUF);
- }
- /* abort this event */
- if (error != 0)
+ if (error != 0) {
+ if (mc != NULL)
+ mlx_releasecmd(mc);
+ if (result != NULL)
+ free(result, M_DEVBUF);
+ /* abort this event */
MLX_PERIODIC_UNBUSY(sc);
+ }
}
/********************************************************************************
@@ -1404,6 +1404,7 @@ mlx_enquire(struct mlx_softc *sc, int command, size_t bufsize, void (* complete)
/* we got a command, but nobody else will free it */
if ((complete == NULL) && (mc != NULL))
mlx_releasecmd(mc);
+ /* we got an error, and we allocated a result */
if ((error != 0) && (result != NULL)) {
free(result, M_DEVBUF);
result = NULL;
OpenPOWER on IntegriCloud