NetBSD Problem Report #58768

From bad@bsd.de  Mon Oct 21 20:22:24 2024
Return-Path: <bad@bsd.de>
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)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id A7C5F1A923D
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 21 Oct 2024 20:22:24 +0000 (UTC)
Message-Id: <20241021202219.GB29343@irregular-apocalypse.k.bsd.de>
Date: Mon, 21 Oct 2024 22:22:19 +0200
From: Christoph Badura <bad@bsd.de>
Reply-To: Christoph Badura <bad@bsd.de>
To: gnats-bugs@NetBSD.org
Subject: mount_9p: missing pathconf(2) support
X-Send-Pr-Version: 3.95

>Number:         58768
>Notify-List:    riastradh@NetBSD.org
>Category:       bin
>Synopsis:       ls: /mnt/.git: Operation not supported
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          needs-pullups
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 21 20:25:01 +0000 2024
>Closed-Date:    
>Last-Modified:  Sat Mar 15 08:55:01 +0000 2025
>Originator:     Christoph Badura <bad@bsd.de>
>Release:        NetBSD 10.99.11
>Organization:
Bozotic Software Testing Labs
>Environment:
	<The following information is extracted from your kernel. Please>
	<append output of "ldd", "ident" where relevant (multiple lines).>
System: NetBSD nb10-99-11.local 10.99.11 NetBSD 10.99.11 (GENERIC) #0: Tue Oct 1 00:07:37 CEST 2024 bad@inspiral-coalescence-ringdown:/Users/bad/netbsd-gsoc/obj/obj.amd64/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
sources from 2024-07-28 with unrelated local changes
>Description:
	I've traced this down to usr.bin/puffs/mount_9p/ninepuffs.c not 
	handling pathconf in PUFFSOP_SET(pops, puffs9p, node, ...);
	<precise description of the problem (multiple lines)>
>How-To-Repeat:
# src from 2024-07-28 with unrelated local changes
$ ls src/build.sh
src/build.sh
$ cat src/sys/arch/amd64/conf/GENERIC.local
ifndef xpci
vio9p*  at virtio?                      # Virtio 9P device
endif
$ ( cd src || exit 1; OBJ=../obj ;  ./build.sh -m amd64 -U -T ${OBJ}/tools \
  -O "${OBJ}/obj.${MACHINE}" -D "${OBJ}/destdir.${MACHINE}" \
  -R "${OBJ}/releasedir.${MACHINE}" release iso-image 
$

$ qemu-system-x86_64  -version
$ qemu-system-x86_64  -M q35 -cpu host -accel hvf -smp 2 -m 512 \
  -cdrom obj/releasedir.amd64/images/NetBSD-10.99.11-amd64-dvd.iso \
  -fsdev local,id=src,security_model=none,path=src,readonly=on \
  -device virtio-9p-pci,fsdev=src,mount_tag=src -nographic
# drop to boot prompt
# consdev com0,115200
# menu
# 1. Boot normally
# exit sysinst
( cd /dev && sh MAKEDEV vio9p0; ls -l vio9p0)
mount -t9p -r -o-cu /dev/vio9p0 /mnt
ls /mnt
ls -l /mnt
# total 187
ls: /mnt/.git: Operation not supported

>Fix:
Implement pathconf support in usr.bin/puffs/mount_9p/ninepuffs.c
	<how to correct or work around the problem, if known (multiple lines)>

>Release-Note:

>Audit-Trail:
From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/58768 CVS commit: src/usr.sbin/puffs/mount_9p
Date: Mon, 10 Mar 2025 21:21:20 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Mon Mar 10 21:21:20 UTC 2025

 Modified Files:
 	src/usr.sbin/puffs/mount_9p: ninepuffs.c node.c

 Log Message:
 mount_9p(8): Implement pathconf stub.

 Doesn't actually do anything useful -- it just returns EINVAL as
 pathconf is supposed to for unknown pathconf key names; by default, it
 will return ENOTSUPP, which leads applications like ls(1) to print:

 ls: /mnt/.git: Operation not supported

 This is a little silly; perhaps puffs should use EINVAL itself instead
 of ENOTSUPP.  But this change is less risky for now.

 PR bin/58768: mount_9p: missing pathconf(2) support


 To generate a diff of this commit:
 cvs rdiff -u -r1.34 -r1.35 src/usr.sbin/puffs/mount_9p/ninepuffs.c
 cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/puffs/mount_9p/node.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->needs-pullups
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Mon, 10 Mar 2025 21:41:21 +0000
State-Changed-Why:
fixed in HEAD, needs pullup-9 and pullup-10
maybe also needs more comprehensive fix in puffs itself


From: matthew green <mrg@eterna23.net>
To: gnats-bugs@netbsd.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, riastradh@NetBSD.org,
    Christoph Badura <bad@bsd.de>
Subject: re: bin/58768 (ls: /mnt/.git: Operation not supported)
Date: Sat, 15 Mar 2025 19:51:57 +1100

 > maybe also needs more comprehensive fix in puffs itself

 it sounds like what i see with mount_pssshfs sometimes.


 .mrg.

>Unformatted:
 	<Please check that the above is correct for the bug being reported,>
 	<and append source date of snapshot, if applicable (one line).>

NetBSD Home
NetBSD PR Database Search

(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-2025 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.