NetBSD-Bugs archive

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

Re: kern/56130: fdescfs create nodes with wrong major number



The following reply was made to PR kern/56130; it has been noted by GNATS.

From: mlelstv%serpens.de@localhost (Michael van Elst)
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/56130: fdescfs create nodes with wrong major number
Date: Mon, 26 Apr 2021 09:02:06 -0000 (UTC)

 lenzi.sergio%gmail.com@localhost writes:
 
 >when mount fdesc the devices /dev/fd/0 /dev/fd/1 .... have the major assign to 5 instead of 22, so the open /dev/fd/0 result in Devince not configured message\
 >this happens in both 9.1 and 9.99.XX also
 
 The problem is not the major number, it isn't used when you open a file
 on the fdesc filesystem.
 
 When you open a special file on UFS, it mogrifies the vnode to reference
 specfs. That's where the major/minor numbers are used, and that's how
 without the fdesc filesystem you can acess /dev/fd/* or e.g. /dev/stdin
 where specfs would call the filedesc driver (major 22).
 
 fdesc just duplicates the process filedescriptor itself, just like the
 filedesc driver would do, without going through specfs. The advantage is
 that you can do a ls -l and see directly the filesystem objects that
 have been opened by the process.
 
 
 The bug you found is that fdesc keeps the /dev/fd/* entries internally
 as VNON vnodes, and 2 years ago hannken@ added a sanity check to the
 kernel that forbids to open VNON vnodes with an ENXIO error.
 
 I'm not sure if that sanity check is overreaching or whether fdesc
 should just use a VREG vnode.
 


Home | Main Index | Thread Index | Old Index