From owner-freebsd-arch@freebsd.org Tue Feb 12 07:22:29 2019 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C33A914D9ADE for ; Tue, 12 Feb 2019 07:22:29 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) 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 351A275C98 for ; Tue, 12 Feb 2019 07:22:29 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: by mailman.ysv.freebsd.org (Postfix) id E806814D9ADD; Tue, 12 Feb 2019 07:22:28 +0000 (UTC) Delivered-To: arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D531014D9ADC for ; Tue, 12 Feb 2019 07:22:28 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 6B42575C91; Tue, 12 Feb 2019 07:22:28 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (v-critter.freebsd.dk [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id 01A982025652; Tue, 12 Feb 2019 07:22:26 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTPS id x1C7MQjI086318 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 12 Feb 2019 07:22:26 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.15.2/8.15.2/Submit) id x1C7MQ6N086317; Tue, 12 Feb 2019 07:22:26 GMT (envelope-from phk) To: cem@freebsd.org cc: "freebsd-arch@freebsd.org" Subject: Re: RFC: What to do about VOP_INACTIVE? In-reply-to: From: "Poul-Henning Kamp" References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <86315.1549956146.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Tue, 12 Feb 2019 07:22:26 +0000 Message-ID: <86316.1549956146@critter.freebsd.dk> X-Rspamd-Queue-Id: 6B42575C91 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Feb 2019 07:22:29 -0000 -------- In message , Conrad Meyer writes: >The nominal return type of the VOP_INACTIVE vnode method is 'int', but >in practice any error returned is silently discarded. The return type is an historical accident from John Heidemann's phd. The way he implemented stackable filesystems cast all VOP's to: typedef int vop_t __P((void *)); So that filesystems could have a VOP methodvector which looked like: static struct vnodeopv_entry_desc fifo_vnodeop_entries[] =3D { { &vop_default_desc, (vop_t *) vn_default_error }, { &vop_abortop_desc, (vop_t *) fifo_badop }, { &vop_access_desc, (vop_t *) fifo_ebadf }, { &vop_advlock_desc, (vop_t *) fifo_advlock }, [...] Then on runtime, he built the real vop dispatch tables. Around 1997 I untangled that so that we got compiler type-checks all the way though the VOP calls, and there were enough historical cruft to clean up that I never got around to the return type of the individual VOPs. If you want to fix this, the right thing to do is to add return types in vnode_if.src and teach the tools/vnode_if.awk script about them. -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe = Never attribute to malice what can adequately be explained by incompetence= .