NetBSD Problem Report #30058

From hubert@feyrer.de  Mon Apr 25 18:39:18 2005
Return-Path: <hubert@feyrer.de>
Received: from miyu.feyrer.net (p5492DDB0.dip.t-dialin.net [84.146.221.176])
	by narn.netbsd.org (Postfix) with ESMTP id 3BC0463B116
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 25 Apr 2005 18:39:17 +0000 (UTC)
Message-Id: <200504251839.j3PIdDZT000738@miyu.feyrer.net>
Date: Mon, 25 Apr 2005 20:39:13 +0200 (MEST)
From: Hubert Feyrer <hubert@feyrer.de>
Reply-To: hubert@feyrer.de
To: gnats-bugs@netbsd.org
Subject: 3.0_BETA: setextattr(1) and extattr(9) not working
X-Send-Pr-Version: 3.95

>Number:         30058
>Category:       kern
>Synopsis:       3.0_BETA: setextattr(1) and extattr(9) not working
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 25 18:40:00 +0000 2005
>Closed-Date:    Sat Dec 05 18:53:06 +0000 2020
>Last-Modified:  Sat Dec 05 18:53:06 +0000 2020
>Originator:     Hubert Feyrer
>Release:        NetBSD 3.0_BETA
>Organization:
bla!
>Environment:


System: NetBSD miyu 3.0_BETA NetBSD 3.0_BETA (MIYU) #3: Thu Mar 31 23:00:08 MEST 2005 feyrer@miyu:/home/cvs/src-3/sys/arch/i386/compile/obj.i386/MIYU i386
Architecture: i386
Machine: i386
>Description:
	The examples in the setextattr(1) manpages don't work:
	1) NetBSD's md5 doesn't know about -q
	2) There is no /boot/anything
	3) When called properly, the filesystem doesn't support the
	   extended attributes:

		miyu# df -k .
		Filesystem  1K-blocks      Used     Avail Capacity  Mounted on
		/dev/wd1e   237606103  98224750 127501048    43%    /

		miyu# dumpfs /dev/rwd0a | head
		file system: /dev/rwd0a
		endian  little-endian
		location 65536  (-b 128)
		magic   19540119 (UFS2) time    Mon Apr 25 20:07:35 2005
		superblock location     65536   id      [ 4234defb 3675e31e ]
		cylgrp  dynamic inodes  FFSv2   sblock  FFSv2   fslevel 5
		nbfree  18447   ndir    1637    nifree  74099   nffree  9513
		ncg     9       size    380016  blocks  357479
		bsize   8192    shift   13      mask    0xffffe000
		fsize   1024    shift   10      mask    0xfffffc00

		miyu# cp /bin/ls  foo
		miyu# setextattr system attrnam attrval foo
		setextattr: foo: failed: Operation not supported

		miyu# ktrace -id setextattr system attrnam attrval foo
		miyu# kdump 
		...
		   495 setextattr CALL  extattr_set_file(0xbfbfec3e,2,0xbfbfec2e,0x804c030,7)
		   495 setextattr NAMI  "foo"
		   495 setextattr RET   extattr_set_file -1 errno 45 Operation not supported
		...

	Following discussion on tech-kern@, it seems that extattr bits have
	not been integrated into the FFS code yet.  The VFS layer changes
	are present, but not the file system layers.[*]

	[*] http://mail-index.netbsd.org/tech-kern/2005/04/25/0008.html


>How-To-Repeat:
	See above.
>Fix:
	1) Short term: Fix manpage. Patch below.
	2) Then: Fix file system layers.


Index: usr.bin/extattr/getextattr.1
===================================================================
RCS file: /cvsroot/src/usr.bin/extattr/getextattr.1,v
retrieving revision 1.2
diff -u -r1.2 getextattr.1
--- usr.bin/extattr/getextattr.1	2 Jan 2005 18:41:23 -0000	1.2
+++ usr.bin/extattr/getextattr.1	25 Apr 2005 18:38:13 -0000
@@ -33,7 +33,7 @@
 .\"
 .\" $FreeBSD: src/usr.sbin/extattr/rmextattr.8,v 1.4 2003/02/24 22:53:25 ru Exp $
 .\"
-.Dd January 2, 2005
+.Dd April 25, 2005
 .Dt RMEXTATTR 8
 .Os
 .Sh NAME
@@ -135,3 +135,13 @@
 The
 .Nm setextattr
 utility can only be used to set attributes to strings.
+.Pp
+Currently the 
+.Xr setextattr 8
+(etc.) tools and anything using 
+.Xr extattr 9
+do not work on
+.Nx
+because the extattr code has not been integrated into the FFS  
+code yet.  The VFS layer changes are present, but not the file system  
+layers.
Index: share/man/man9/extattr.9
===================================================================
RCS file: /cvsroot/src/share/man/man9/extattr.9,v
retrieving revision 1.2
diff -u -r1.2 extattr.9
--- share/man/man9/extattr.9	2 Jan 2005 18:32:38 -0000	1.2
+++ share/man/man9/extattr.9	25 Apr 2005 18:38:13 -0000
@@ -26,7 +26,7 @@
 .\"
 .\" FreeBSD: src/share/man/man9/extattr.9,v 1.14 2003/10/23 02:33:03 hmp Exp
 .\"
-.Dd January 2, 2005
+.Dd April 25, 2005
 .Os
 .Dt EXTATTR 9
 .Sh NAME
@@ -84,3 +84,13 @@
 .Sh SEE ALSO
 .Xr vfsops 9 ,
 .Xr vnodeops 9
+.Sh BUGS
+Currently the
+.Xr setextattr 8
+(etc.) tools and anything using
+.Xr extattr 9
+do not work on
+.Nx
+because the extattr code has not been integrated into the FFS
+code yet.  The VFS layer changes are present, but not the file system
+layers.

>Release-Note:

>Audit-Trail:
From: Christian Kujau <lists@nerdbynature.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/30058
Date: Fri, 16 Aug 2019 23:42:29 -0700 (PDT)

 While the first topic of this PR appears to be no longer valid (md5 now 
 supports -q), extended attributes are still not working in NetBSD 8.1:

  # newfs -O 1 /dev/rwd1a
  # mount -t ffs -o extattr /dev/wd1a /mnt/test/
  # cd /mnt/test && touch foo
  # setextattr system bar baz foo
  setextattr: foo: failed: Operation not supported

  # dmesg | tail -1
  /mnt/test: failed to start extattr: error = 2

  # config -x /netbsd | grep EXTA
  options         UFS_EXTATTR  # Extended attribute support for UFS1


 Curiously enough, while the original PR is from 2005, two commits[0] to 
 sys/ufs/ufs/extattr.h and sys/ufs/ufs/ufs_extattr.c from 2014 and 2016 can 
 be found, but I'm wondering if UFS_EXTATTR was even tested in the last 
 couple of years. FWIW, EA support has been removed from OpenBSD in 2005, 
 so maybe the code can be removed from NetBSD as well? It'd be nice to have 
 it working though :-D

 Thanks,
 Christian.

 [0] https://github.com/NetBSD/src/commit/6862ff49
     Bump UFS1 extended attribute max name length to 256

     https://github.com/NetBSD/src/commit/5609226e
     Explain why the lock in here needs to be recursive. Related to PR 46997.

 [1] https://github.com/openbsd/src/commit/9dd8235
     Extended Attributes was a piece to get to ACLs
 -- 
 BOFH excuse #67:

 descramble code needed from software company

From: Christos Zoulas <christos@zoulas.com>
To: gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org,
 gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org,
 hubert@feyrer.de
Subject: Re: kern/30058
Date: Mon, 19 Aug 2019 12:49:09 +0300

 I just tested extattr on HEAD and it works... I added some more printfs =
 in the extattr startup code which should give a hint as to what's =
 broken.
 - If you are using modules for ufs and ffs extattr support was not =
 enabled for them until now.
 - it seems that you need to mkdir -p .attribute/system .attribute/user =
 in the root directory before you can create extended attributes. Perhaps =
 this should be automatic.
 - I cleared the extattr bit on mount if we could not start extattrs now.

 Best,

 christos

State-Changed-From-To: open->feedback
State-Changed-By: maya@NetBSD.org
State-Changed-When: Tue, 20 Aug 2019 05:52:36 +0000
State-Changed-Why:
Are you still having trouble?


State-Changed-From-To: feedback->closed
State-Changed-By: hubertf@NetBSD.org
State-Changed-When: Sat, 05 Dec 2020 18:53:06 +0000
State-Changed-Why:
I cannot test this. Closing the PR now.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.