NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/57277: struct fileops should have .fo_advlock and .fo_pathconf



>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:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 18 16:05:00 +0000 2023
>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!



Home | Main Index | Thread Index | Old Index