NetBSD Problem Report #57277
From www@netbsd.org Sat Mar 18 16:02:06 2023
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 9BB841A923A
for <gnats-bugs@gnats.NetBSD.org>; Sat, 18 Mar 2023 16:02:06 +0000 (UTC)
Message-Id: <20230318160205.29EFB1A923B@mollari.NetBSD.org>
Date: Sat, 18 Mar 2023 16:02:05 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: struct fileops should have .fo_advlock and .fo_pathconf
X-Send-Pr-Version: www-1.0
>Number: 57277
>Category: kern
>Synopsis: struct fileops should have .fo_advlock and .fo_pathconf
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Mar 18 16:05:00 +0000 2023
>Closed-Date: Wed Apr 17 17:16:48 +0000 2024
>Last-Modified: Wed Apr 17 17:16:48 +0000 2024
>Originator: Taylor R Campbell
>Release: current
>Organization:
The NetBSD Flockation
>Environment:
choking on the fumes of millennia past exhumed from the earth
>Description:
The fcntl F_SETLKW, F_SETLK, and F_GETLK commands, and the flock system call, are implemented by a test for the type of the file descriptor (DTYPE_VNODE) and direct calls to VOP_ADVLOCK.
This creates an unnecessary coupling between the file descriptor and syscall components of the system, and the vfs/vnode components of the system.
The same goes for the fpathconf system call, which also applies to sockets and pipes, not just files in a file system with VOP_PATHCONF.
Instead, like we did for VOP_SEEK with .fo_seek, we should push these into struct fileops with .fo_advlock and .fo_pathconf methods:
https://mail-index.netbsd.org/source-changes/2021/09/11/msg132205.html
>How-To-Repeat:
Try to build rump kernel without -lrumpvfs.
>Fix:
Yes, please!
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Wed, 17 Apr 2024 17:16:48 +0000
State-Changed-Why:
fixed by
https://mail-index.netbsd.org/source-changes/2023/04/22/msg144254.html (fo_advlock)
https://mail-index.netbsd.org/source-changes/2023/04/22/msg144255.html (fo_fpathconf)
inapplicable for pullup because kernel ABI change
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.