From owner-freebsd-arch@freebsd.org Tue Feb 12 00:52:15 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 281BC14E8D4C for ; Tue, 12 Feb 2019 00:52:15 +0000 (UTC) (envelope-from cse.cem@gmail.com) 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 90FDC91AF0 for ; Tue, 12 Feb 2019 00:52:14 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 4A94414E8D4B; Tue, 12 Feb 2019 00:52:14 +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 2671714E8D4A for ; Tue, 12 Feb 2019 00:52:14 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f182.google.com (mail-it1-f182.google.com [209.85.166.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 420E991AEA for ; Tue, 12 Feb 2019 00:52:13 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f182.google.com with SMTP id b5so3216065iti.2 for ; Mon, 11 Feb 2019 16:52:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:from:date:message-id :subject:to; bh=FI056E7OgijNKE8StvaHP1JvPLnIXVViTZlA6fZbCF0=; b=T9lnjAxqZgNg/9G73DLh6LOZ9tWDq6+5dWbcsEIFNUuLyb8aBxbAImE5LLwMNSrgyh tsndZKlsGgYFs9tpgib29iyEq0tFqf4w7pB+P9eme40WnAq7lbY24bt590M7TxdkgvFj YenGDCZ/snGy1Zku2whpeE6bEh22D/tsecBCKRnxtuoqv0iPlJn0gaZFo21H72Q9XEX1 qLhufGe/MdIl25uSC0uB3jFXv6Li45/1/LWSwfBP3PMbjf0LCxnEXErcBXGqFE+0n+xO G4cd3mnjJHohyTRkBkAZ0zXQPRQ/YHiiWThxg5BBXWjUZZVky9biW5WlGWnQEqODqdqH hd4A== X-Gm-Message-State: AHQUAuaSq3qCa1nU9Zl55xmQ/2oiejPIXW3EsJsPN9t8HxdULLEnoZTQ gEb9yyv314dPbWxruyEcOb+YbtSe X-Google-Smtp-Source: AHgI3IY0pD69rig1cBWF05uOoddEDdAeWuJwsEUNWKF22SAjeqpu+42vI9h1GszD3MbXm3f+wBFV3w== X-Received: by 2002:a6b:b241:: with SMTP id b62mr555339iof.261.1549932731780; Mon, 11 Feb 2019 16:52:11 -0800 (PST) Received: from mail-it1-f177.google.com (mail-it1-f177.google.com. [209.85.166.177]) by smtp.gmail.com with ESMTPSA id p2sm5238736iog.84.2019.02.11.16.52.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Feb 2019 16:52:11 -0800 (PST) Received: by mail-it1-f177.google.com with SMTP id v72so3260578itc.0 for ; Mon, 11 Feb 2019 16:52:11 -0800 (PST) X-Received: by 2002:a24:2f82:: with SMTP id j124mr481287itj.166.1549932730892; Mon, 11 Feb 2019 16:52:10 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 11 Feb 2019 16:52:00 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: RFC: What to do about VOP_INACTIVE? To: "freebsd-arch@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 420E991AEA X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.166.182 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-4.74 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; TO_DOM_EQ_FROM_DOM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; TAGGED_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[arch@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; SUBJECT_ENDS_QUESTION(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[182.166.85.209.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.78)[ip: (-8.12), ipnet: 209.85.128.0/17(-3.77), asn: 15169(-1.96), country: US(-0.07)] 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 00:52:15 -0000 Hello, The nominal return type of the VOP_INACTIVE vnode method is 'int', but in practice any error returned is silently discarded. The only caller is vinactive(), which is also a void routine. vinactive ignores the return value of VOP_INACTIVE(). (vinactive tends to be called by other void routines, like vput(), so propagating an error up the stack is non-trivial.) In practice, most filesystems in the kernel unconditionally return zero for INACTIVE. The exceptions are: msdosfs, ext2fs, nandfs, and (notably) ufs. The problem (as I see it) is that the return type makes it appear that INACTIVE is allowed to fail, but it is not. One important ramification of this is that interruptible sleeps in INACTIVE are basically not permitted. This seems problematic because INACTIVE is invoked as part of close(2), and we can potentially block that user process indefinitely when the kernel filesystem is stalled on a network resource, or something like a FUSE userspace filesystem (which can also access network resources). Can we live with the current behavior (INACTIVE cannot fail)? In that case, I think we should change its return type to void to match. Thoughts? Thanks, Conrad