In umass_detach set sc_dyring so that further attempts at transfers will

fail.  This fixes part of

PR/51129 (Disconnecting USB SD card without umount causes file operations to hang)
This commit is contained in:
skrll 2017-04-25 05:36:03 +00:00
parent af56b75b7d
commit a06215af07

View File

@ -1,4 +1,4 @@
/* $NetBSD: umass.c,v 1.157 2016/11/21 08:27:30 skrll Exp $ */
/* $NetBSD: umass.c,v 1.158 2017/04/25 05:36:03 skrll Exp $ */
/*
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@ -124,7 +124,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.157 2016/11/21 08:27:30 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.158 2017/04/25 05:36:03 skrll Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@ -796,6 +796,8 @@ umass_detach(device_t self, int flags)
DPRINTFM(UDMASS_USB, "sc %p detached", sc, 0, 0, 0);
sc->sc_dying = true;
pmf_device_deregister(self);
/* Abort the pipes to wake up any waiting processes. */