From owner-freebsd-current Tue Jan 19 03:46:13 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id DAA25107 for freebsd-current-outgoing; Tue, 19 Jan 1999 03:46:13 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from iclub.nsu.ru (iclub.nsu.ru [193.124.222.66]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id DAA24903 for ; Tue, 19 Jan 1999 03:42:45 -0800 (PST) (envelope-from semen@iclub.nsu.ru) Received: from localhost (semen@localhost) by iclub.nsu.ru (8.8.8/8.8.5) with SMTP id RAA14565 for ; Tue, 19 Jan 1999 17:42:15 +0600 (NS) Date: Tue, 19 Jan 1999 17:42:14 +0600 (NS) From: Ustimenko Semen To: freebsd-current@FreeBSD.ORG Subject: sys/kern/kern_linker.c patch Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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