From owner-freebsd-fs@freebsd.org Sun Mar 6 03:06:50 2016 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D2E8A92FF3 for ; Sun, 6 Mar 2016 03:06:50 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 1DFAFC24 for ; Sun, 6 Mar 2016 03:06:50 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: by mailman.ysv.freebsd.org (Postfix) id 1A75DA92FF1; Sun, 6 Mar 2016 03:06:50 +0000 (UTC) Delivered-To: fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19E15A92FEF; Sun, 6 Mar 2016 03:06:50 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.net.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 6DD9FC20; Sun, 6 Mar 2016 03:06:48 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) IronPort-PHdr: 9a23:y0MephYh0UWE+WqeSx8+bf3/LSx+4OfEezUN459isYplN5qZpcu6bnLW6fgltlLVR4KTs6sC0LqJ9f+wEjVQsN6oizMrTt9lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUiv2OQc9HOnpAIma153xjLDtvcKDKFwY1XKUWvBbElaflU3prM4YgI9veO4a6yDihT92QdlQ3n5iPlmJnhzxtY+a9Z9n9DlM6bp6r5YTGY2zRakzTKRZATI6KCh1oZSz7ViQBTeIs1gRVC0znwBSEkCR7xz8dpnrvybwreY73zOVa57YV7cxDA6j5KQjbRbjiyMKMnZt6mTegc90gadzvRWuuhF7246Sa4jDZ6k2Rb/UYd5PHTkJZc1WTSEUR9rkN4Y= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DQAQB/ndtW/61jaINdFoN2bQa6OgENgWkXCoUkSgKBVBQBAQEBAQEBAWMngi2CFAEBAQMBAQEBIAQnIAsFCwIBCBgCAg0ZAgInAQkmAgQIBwQBHAICh3kIDrA+jlABAQEBAQEEAQEBAQEBAQEUBHuFHIF3gkaEGwEBG4MCgToFh1iGTD2ISYVjhSGETIREiFOOUwIeAQFChAIeLgEBAQSIBzR+AQEB X-IronPort-AV: E=Sophos;i="5.22,544,1449550800"; d="scan'208";a="270953938" Received: from nipigon.cs.uoguelph.ca (HELO zcs1.mail.uoguelph.ca) ([131.104.99.173]) by esa-annu.net.uoguelph.ca with ESMTP; 05 Mar 2016 22:06:41 -0500 Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 450B015F565; Sat, 5 Mar 2016 22:06:41 -0500 (EST) Received: from zcs1.mail.uoguelph.ca ([127.0.0.1]) by localhost (zcs1.mail.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id YFPGxz6bFf3n; Sat, 5 Mar 2016 22:06:40 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 7F3BC15F56D; Sat, 5 Mar 2016 22:06:40 -0500 (EST) X-Virus-Scanned: amavisd-new at zcs1.mail.uoguelph.ca Received: from zcs1.mail.uoguelph.ca ([127.0.0.1]) by localhost (zcs1.mail.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id SFuSwJoICiuZ; Sat, 5 Mar 2016 22:06:40 -0500 (EST) Received: from zcs1.mail.uoguelph.ca (zcs1.mail.uoguelph.ca [172.17.95.18]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 61E4915F565; Sat, 5 Mar 2016 22:06:40 -0500 (EST) Date: Sat, 5 Mar 2016 22:06:40 -0500 (EST) From: Rick Macklem To: Ken Merry Cc: fs@freebsd.org, scsi@freebsd.org, Robert Watson Message-ID: <800018199.6694281.1457233600357.JavaMail.zimbra@uoguelph.ca> In-Reply-To: References: Subject: Re: FUSE extended attribute patches available MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [172.17.95.12] X-Mailer: Zimbra 8.0.9_GA_6191 (ZimbraWebClient - FF44 (Win)/8.0.9_GA_6191) Thread-Topic: FUSE extended attribute patches available Thread-Index: hQcBf8vLnYvQAb3eet2rDypFlNoDHA== X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Mar 2016 03:06:50 -0000 Ken Merry wrote: > I have patches for FreeBSD=E2=80=99s FUSE filesystem kernel module to sup= port > extended attributes: >=20 > https://people.freebsd.org/~ken/fuse_extattr.20160229.1.txt >=20 The only bit of code I have that might be useful for this patch is: =09case FUSE_GETXATTR: =09case FUSE_LISTXATTR: ! =09=09/* ! =09=09 * These can have varying response lengths, and 0 length ! =09=09 * isn't necessarily invalid. ! =09=09 */ ! =09=09err =3D 0; *** I came up with this: =09=09fgin =3D (struct fuse_getxattr_in *) =09=09 ((char *)ftick->tk_ms_fiov.base + =09=09 sizeof(struct fuse_in_header)); =09=09if (fgin->size =3D=3D 0) =09=09=09err =3D (blen =3D=3D sizeof(struct fuse_getxattr_out)) ? 0 : =09=09=09 EINVAL; =09=09else =09=09=09err =3D (blen <=3D fgin->size) ? 0 : EINVAL; =09=09break; I think I got the size check right? The big question is... What to do with the NAMESPACE? - My code fails for SYSTEM and does USER without prepending "user.". (That seemed to be what rwatson@ felt was reasonable. I thought our discussion was on a mailing list, but I can't find it.) I've cc'd him. Maybe he can comment again. - If you stick with prepending "user." or "system." there needs to be some way to bypass this so that attributes that don't start in "user." or "system." can be accessed. I've seen "trusted." and "glusterfs." on GlusterFS. --> Maybe a new namespace called something like "nil" that just bypasses any USER or SYSTEM checks? rick > The patch implements the get/set/delete/list extended attribute methods. = The > listing code also converts extended attribute lists from the Linux/FUSE > format to the FreeBSD format. For example: >=20 > # touch foo > # ls -la foo > -rwxrwxrwx 1 root wheel 0 Feb 29 21:40 foo > # lsextattr user foo > foo > # setextattr user testattr1 "12345678" foo > # lsextattr user foo > foo testattr1 > # getextattr user testattr1 foo > foo 12345678 > # setextattr user testattr2 "87654321" foo > # lsextattr user foo > foo testattr2 testattr1 > # rmextattr user testattr1 foo > # lsextattr user foo > foo testattr2 > # getextattr user testattr1 foo > getextattr: foo: failed: Attribute not found > # getextattr user testattr2 foo > foo 87654321 >=20 >=20 > Just to be clear on what this does, it only provides extended attribute > support to FreeBSD applications if the underlying FUSE filesystem impleme= nts > FUSE extended attribute support. Many FUSE filesystems don=E2=80=99t sup= port the > extended attribute VFS operations. >=20 > I have tested this out on IBM=E2=80=99s LTFS implementation, but I have n= ot yet found > another FUSE filesystem that supports extended attributes. If anyone kno= ws > of one, please let me know so I can try it out. (I looked through a numb= er > of the filesystems in sysutils/fusefs* in the ports tree.) >=20 > Any feedback is welcome. I=E2=80=99m planning to check this into FreeBSD= /head in the > next week or so. >=20 > Obviously, I=E2=80=99ve also ported IBM=E2=80=99s LTFS implementation to = FreeBSD. It works > in the standard FUSE mode, and you can also link it into an application a= s a > library if you don=E2=80=99t want to incur the overhead of running throug= h FUSE. I > haven=E2=80=99t gotten around to packaging it up to go out for testing / = review. >=20 > If anyone has IBM LTO-5 or newer tape drives, or IBM TS1140 or newer tape > drives, and wants to try it out, let me know. I=E2=80=99ll send you the = code when > I=E2=80=99ve got it at least somewhat ready. This is IBM-specific, and w= on=E2=80=99t work > on HP tape drives. >=20 > Ken > =E2=80=94 > Ken Merry > ken@FreeBSD.ORG >=20 >=20 >=20 > _______________________________________________ > freebsd-fs@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org"