From owner-freebsd-current@freebsd.org Fri Feb 10 14:58:31 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC98CCD86A1 for ; Fri, 10 Feb 2017 14:58:31 +0000 (UTC) (envelope-from iblis@hs.ntnu.edu.tw) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id C7060E3C for ; Fri, 10 Feb 2017 14:58:31 +0000 (UTC) (envelope-from iblis@hs.ntnu.edu.tw) Received: by mailman.ysv.freebsd.org (Postfix) id C362ECD869E; Fri, 10 Feb 2017 14:58:31 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C30BECD869B for ; Fri, 10 Feb 2017 14:58:31 +0000 (UTC) (envelope-from iblis@hs.ntnu.edu.tw) Received: from mail.hs.ntnu.edu.tw (mail.hs.ntnu.edu.tw [140.131.149.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E2F3E39 for ; Fri, 10 Feb 2017 14:58:30 +0000 (UTC) (envelope-from iblis@hs.ntnu.edu.tw) Received: by mail.hs.ntnu.edu.tw (Postfix, from userid 800) id 01B9F1C647B; Fri, 10 Feb 2017 22:58:23 +0800 (CST) Received: from abeing (IP-215-9.cs.nctu.edu.tw [140.113.215.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: iblis@hs.ntnu.edu.tw) by mail.hs.ntnu.edu.tw (Postfix) with ESMTPSA id C61101C6450; Fri, 10 Feb 2017 22:58:23 +0800 (CST) Date: Fri, 10 Feb 2017 22:58:22 +0800 From: Iblis Lin To: Konstantin Belousov Cc: David Wolfskill , current@freebsd.org Subject: Re: dhclient fails: can't open and lock /var/db/dhclient.leases.wlan0: Bad file descriptor Message-ID: <20170210145822.GA30133@abeing> References: <20170210132954.GE1523@albert.catwhisker.org> <20170210141041.GR2092@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170210141041.GR2092@kib.kiev.ua> User-Agent: Mutt/1.7.1 (2016-10-04) X-Bogosity: Ham, tests=bogofilter, spamicity=0.500000, version=1.2.4 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2017 14:58:32 -0000 On Fri, Feb 10, 2017 at 04:10:41PM +0200, Konstantin Belousov wrote: > On Fri, Feb 10, 2017 at 05:29:54AM -0800, David Wolfskill wrote: > > This was head @r313544; previous successful build/smoke test was > > @r313467 (yesterday). > > > > Here's an excerpt from a typescript I made of some "poking around"; > > subsequent to that, I was able to set the IP address, netmask, and > > broadcast address on the NIC (wlano), then set the default route, and > > once that was done, I was able to use the network: > > > > wlan0: flags=8843 metric 0 mtu 1500 > > ether 00:24:d6:7a:03:ce > > inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255 > > nd6 options=29 > > media: IEEE 802.11 Wireless Ethernet MCS mode 11ng > > status: associated > > ssid lmdhw-net channel 1 (2412 MHz 11g ht/20) bssid 04:18:d6:22:22:1f > > regdomain FCC country US authmode WPA2/802.11i privacy ON > > deftxkey UNDEF AES-CCM 2:128-bit txpower 30 bmiss 10 scanvalid 60 > > protmode CTS ampdulimit 64k ampdudensity 8 -amsdutx amsdurx shortgi > > -stbc -ldpc wme roaming MANUAL > > groups: wlan > > (12.0-C)[4] pgrep dhclient > > (12.0-C)[5] dhclient wlan0 > > dhclient: /etc/dhclient-enter-hooks invoked with reason PREINIT > > dhclient: Leaving hostname set to > > dhclient: /etc/dhclient-exit-hooks invoked with reason PREINIT > > dhclient: reason was PREINIT; no action taken > > dhclient: Exiting /etc/dhclient-exit-hooks (PREINIT) with exit_status 0 > > can't open and lock /var/db/dhclient.leases.wlan0: Bad file descriptor > > exiting. > > (12.0-C)[6] ls -lTio /var/db/dhclient.leases* > > 883105 ---------- 1 root wheel - 4017 Jan 4 09:18:10 2017 /var/db/dhclient.leases.em0 > > 883280 ---------- 1 root wheel - 856 Aug 11 04:52:54 2015 /var/db/dhclient.leases.lagg0 > > 883344 ---------- 1 root wheel - 3333 Jan 20 21:19:10 2015 /var/db/dhclient.leases.vboxnet0 > > 883108 ---------- 1 root wheel - 1993 Feb 10 04:30:13 2017 /var/db/dhclient.leases.wlan0 > > 883079 ---------- 1 root wheel - 2013 Jan 19 11:52:07 2017 /var/db/dhclient.leases.wlan1 > > > > > > Moving /var/db/dhclient.leases.wlan0 aside did not change the behavior. > > > > Stable/11 shows the iwn(4) device as: > > g1-252(11.0-S)[4] pciconf -lv | grep -A 3 iwn > > iwn0@pci0:3:0:0: class=0x028000 card=0x13218086 chip=0x42328086 rev=0x00 hdr=0x00 > > vendor = 'Intel Corporation' > > device = 'WiFi Link 5100' > > class = network > > g1-252(11.0-S)[5] > > > > File system for /var is a fairly vanilla UFS2+SU. I suppose I could have > > tried ktrace (had I thought of it before switching back to the stable/11 > > slice). > > > > Please try this. > > diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c > index 70cdcdc6f75..1f2cceaf7a6 100644 > --- a/sys/kern/vfs_vnops.c > +++ b/sys/kern/vfs_vnops.c > @@ -351,8 +351,8 @@ vn_open_vnode(struct vnode *vp, int fmode, struct ucred *cred, > > while ((fmode & (O_EXLOCK | O_SHLOCK)) != 0) { > KASSERT(fp != NULL, ("open with flock requires fp")); > - if (fp->f_type != DTYPE_VNODE) { > - error = EBADF; > + if (fp->f_type != DTYPE_NONE && fp->f_type != DTYPE_VNODE) { > + error = EOPNOTSUPP; > break; > } > lock_flags = VOP_ISLOCKED(vp); > diff --git a/sys/sys/file.h b/sys/sys/file.h > index 353c92f365a..c51f26a41d2 100644 > --- a/sys/sys/file.h > +++ b/sys/sys/file.h > @@ -53,6 +53,7 @@ struct vnode; > > #endif /* _KERNEL */ > > +#define DTYPE_NONE 0 /* not yet initialized */ > #define DTYPE_VNODE 1 /* file */ > #define DTYPE_SOCKET 2 /* communications endpoint */ > #define DTYPE_PIPE 3 /* pipe */ > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" It works fine for me! :) -- Iblis Lin 林峻頤