Date: Tue, 19 Jan 1999 17:42:14 +0600 (NS) From: Ustimenko Semen <semen@iclub.nsu.ru> To: freebsd-current@FreeBSD.ORG Subject: sys/kern/kern_linker.c patch Message-ID: <Pine.BSF.3.96.990119172807.14095A-100000@iclub.nsu.ru>
next in thread | raw e-mail | index | archive | help
Imagine: I'm trying to unload KLD module, it is busy: # kldunload -n ntfs kldunload: can't unload file: Device busy After this point i'll never get module unloaded becouse kldunload() in sys/kern/kern_linker.c has already decremeted lf->userrefs. I'll get only this messages: # kldunload -n ntfs Jan 18 17:10:13 ws21 /kernel: linkerunload: attempt to unload file which was not loaded by user kldunload: can't unload file: Device busy Here is patch. *** kern_linker.c.orig Mon Jan 18 17:22:39 1999 --- kern_linker.c Mon Jan 18 16:40:33 1999 *************** *** 653,660 **** error = EBUSY; goto out; } - lf->userrefs--; error = linker_file_unload(lf); } else error = ENOENT; --- 653,662 ---- error = EBUSY; goto out; } error = linker_file_unload(lf); + if(error) + goto out; + lf->userrefs--; } else error = ENOENT; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.990119172807.14095A-100000>