From owner-freebsd-fs@FreeBSD.ORG Fri Mar 21 22:20:57 2008 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD2DE1065674 for ; Fri, 21 Mar 2008 22:20:57 +0000 (UTC) (envelope-from V.Haisman@sh.cvut.cz) Received: from service2.sh.cvut.cz (service2.sh.cvut.cz [IPv6:2001:718:2:0:217:a4ff:fe3f:b3d4]) by mx1.freebsd.org (Postfix) with ESMTP id C07018FC13 for ; Fri, 21 Mar 2008 22:20:56 +0000 (UTC) (envelope-from V.Haisman@sh.cvut.cz) Received: from localhost (localhost [127.0.0.1]) by service2.sh.cvut.cz (Postfix) with ESMTP id C311713778A; Fri, 21 Mar 2008 23:20:55 +0100 (CET) Received: from service2.sh.cvut.cz ([127.0.0.1]) by localhost (service2.sh.cvut.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 08048-08; Fri, 21 Mar 2008 23:20:49 +0100 (CET) Received: from logout.sh.cvut.cz (logout.sh.cvut.cz [147.32.127.203]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by service2.sh.cvut.cz (Postfix) with ESMTP id 7481E1377DF; Fri, 21 Mar 2008 23:20:49 +0100 (CET) Received: from [192.168.1.2] (localhost [127.0.0.1]) by logout.sh.cvut.cz (Postfix) with ESMTP id 1D82361C31; Fri, 21 Mar 2008 23:20:49 +0100 (CET) Message-ID: <47E43496.5080201@sh.cvut.cz> Date: Fri, 21 Mar 2008 23:20:06 +0100 From: =?UTF-8?B?VsOhY2xhdiBIYWlzbWFu?= User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: freebsd-fs@freebsd.org X-Enigmail-Version: 0.95.6 OpenPGP: id=1204AF05; url=http://logout.sh.cvut.cz/~wilx/Vaclav_Haisman_(0x63B6B297)_pub.asc Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAMFBMVEUnMzWJm5S+0864pn5r blp/hnW2up7X7uqftbNRVUrW1LGBdGfHwJqPi3ScoYtBQzhDxGEwAAAAB3RJTUUH1QoQDDgyQtx8 HQAAAkNJREFUeJzFU0toU0EUPYu66CpGdCUUmoUJkpUDQUoNBVEUrBJsq1Ki2EIKIUZ8mydBhYi0 wVUXJVCLCrFN4DIEQdxIqdBIFsMkWD9YJClCRGKjJaviynjfe8RPogtXPcObuXPOPXd+PHj+Aeyo QNmobGLXVeANGM+GsP0B2yqHHNVoCD2LwLglVGZx7yXSlADR0uZu9C4Bpy3hUxPvH/cuUw6UoPCL h64I8KAJuMpwRU8uUMJy0OIpHVeXmulZoCc/t0LlTbJLEY1EudPRcnVjgAP5Osdl4K5HVP4+2bAI okaUA0Iq6Q59+Zy2eMWN6EpFTsa3+uD1+JKj4TPHuYTSMaLScLAaqk94YJqG4ds30hojOVgYoNJc NTztNU2TBYbhu9Aafnq08ORja37da1NwBrN/b7NVEc+b8yecuYkp08vNvLYneVZRaSH1vS0UnfHm OUPzWaZufHPmCWSdWrfeGVQQKmcsO4If8pAdXJ/xF4QQAeOVY1AQQcfirwkLUWeWVTgi6vaGt2xe BGzBEIMQorru8RxgPqY1V6uxYnwVBRZEI1ytCm3dE8mC2DgcbzCJGHdBEVDKuWDSwsrSGoqzJmNt 2jJpNueIH0qS8/0JrDKnVBdvOzIsdVr4zaX9dn9xcLLKdCtQGfutVacLE9Ja+yfbDvO4aMWrklfK /JYv15C8Kw9S10kup5Bys0N1bLdcn4HvTl/Xlh6Fpllwj5/XpH9BUXn/ym0Dvv7Rt2MywojpYiSi i7Hsscaa19zZ//y/hR+BT/ns80nmJAAAAABJRU5ErkJggg== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigF74110CD873584BE0BE507C2" X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at service2.sh.cvut.cz X-Spam-Status: No, hits=-2.2 tagged_above=-255.0 required=5.0 tests=AWL, CRM114_HAM_50, JR_RCVD_HOST_PROBS1, JR_RCVD_TOO_FEW_HOPS X-Spam-Level: Subject: Indication of extended attributes availability. X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Mar 2008 22:20:57 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigF74110CD873584BE0BE507C2 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Hi, I would like to have some sort of indication of extended attributes=20 availability for given FS. It seems that things like this (MAC, ACLs etc.= )=20 are indicated using mount flags and those are available through statfs() = call. The following is tentative patch that would expose extended attribu= tes=20 availability as mount flag. It is completely untested. I would just like = to=20 know if it is a viable approach to the problem or should I scratch it and= try=20 something else? --- ./sys/mount.h~ 2007-04-10 12:12:44.000000000 +0200 +++ ./sys/mount.h 2008-03-21 22:48:04.436630277 +0100 @@ -218,7 +218,6 @@ void __mnt_vnode_markerfree(str #define MNT_SYNCHRONOUS 0x00000002 /* filesystem written synchronously = */ #define MNT_NOEXEC 0x00000004 /* can't exec from filesystem */ #define MNT_NOSUID 0x00000008 /* don't honor setuid bits on fs */ -#define MNT_NODEV 0 /* Deprecated option */ #define MNT_UNION 0x00000020 /* union with underlying filesystem */ #define MNT_ASYNC 0x00000040 /* filesystem written asynchronously */ #define MNT_SUIDDIR 0x00100000 /* special handling of SUID on dirs */ @@ -246,6 +245,7 @@ void __mnt_vnode_markerfree(str * but visible to the user. * XXX some of these are not quite right.. (I've never seen the root fl= ag set) */ +#define MNT_EXTATTR 0x00000010 /* filesystem with extended attributes */= #define MNT_LOCAL 0x00001000 /* filesystem is stored locally */ #define MNT_QUOTA 0x00002000 /* quotas are enabled on filesystem */ #define MNT_ROOTFS 0x00004000 /* identifies the root filesystem */ @@ -265,7 +265,8 @@ void __mnt_vnode_markerfree(str MNT_ROOTFS | MNT_NOATIME | MNT_NOCLUSTERR| \ MNT_NOCLUSTERW | MNT_SUIDDIR | MNT_SOFTDEP | \ MNT_IGNORE | MNT_EXPUBLIC | MNT_NOSYMFOLLOW | \ - MNT_JAILDEVFS | MNT_MULTILABEL | MNT_ACLS) + MNT_JAILDEVFS | MNT_MULTILABEL | MNT_ACLS | \ + MNT_EXTATTR) /* Mask of flags that can be updated. */ #define MNT_UPDATEMASK (MNT_NOSUID | MNT_NOEXEC | \ --- ./ufs/ufs/ufs_extattr.c~ 2006-03-13 04:08:08.000000000 +0100 +++ ./ufs/ufs/ufs_extattr.c 2008-03-21 22:59:50.766939565 +0100 @@ -220,6 +220,10 @@ ufs_extattr_start(struct mount *mp, stru ump->um_extattr.uepm_ucred =3D crhold(td->td_ucred); + MNT_ILOCK(mp); + mp->f_flags |=3D MNT_EXTATTR; + MNT_IUNLOCK(mp); + unlock: ufs_extattr_uepm_unlock(ump, td); @@ -549,6 +553,10 @@ ufs_extattr_stop(struct mount *mp, struc uele->uele_attrname, td); } + MNT_ILOCK(mp); + mp->f_flags &=3D ~MNT_EXTATTR; + MNT_IUNLOCK(mp); + ump->um_extattr.uepm_flags &=3D ~UFS_EXTATTR_UEPM_STARTED; crfree(ump->um_extattr.uepm_ucred); -- VH --------------enigF74110CD873584BE0BE507C2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFH5DSfoUFWwtEPkHIRCAEFAJ4uLX92ZBGnGvEw0laJw3Pc09PxlgCeM1RF T+Vv3VW0ngwqaYTxq3T2NVc= =uVTE -----END PGP SIGNATURE----- --------------enigF74110CD873584BE0BE507C2--