From owner-freebsd-scsi@freebsd.org Wed Mar 2 01:04:01 2016 Return-Path: Delivered-To: freebsd-scsi@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 10374ABE6BE for ; Wed, 2 Mar 2016 01:04:01 +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 E49F01C17 for ; Wed, 2 Mar 2016 01:04:00 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: by mailman.ysv.freebsd.org (Postfix) id E09B5ABE6BC; Wed, 2 Mar 2016 01:04:00 +0000 (UTC) Delivered-To: scsi@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 C62F4ABE6BA; Wed, 2 Mar 2016 01:04:00 +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 396111C14; Wed, 2 Mar 2016 01:03:59 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) IronPort-PHdr: 9a23:VQBJoxHYPQl88CXGEufR0p1GYnF86YWxBRYc798ds5kLTJ75osmwAkXT6L1XgUPTWs2DsrQf27WQ7PmrAzxIyK3CmU5BWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYsExnyfTB4Ov7yUtaLyZ/niKbtotaJM01hv3mUX/BbFF2OtwLft80b08NJC50a7V/3mEZOYPlc3mhyJFiezF7W78a0+4N/oWwL46pyv50IbaKvNYc1S7pVEDRuHyZ9wcDxrwiJBV+M6300fH8bnzBzL07i1j6sDbnrtS6vjOt222G/NMb1Sb0xEWC46q5gSxvljQ8aMDEk/WXPiop7hfQI81qauxVjztuMM8muP/1kc/aFcA== X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DPAQBaO9ZW/61jaINcFoN2bQa4GoITAQ2BZiGFcgKCBhQBAQEBAQEBAWMngi2CFAEBAQMBI1YFCwIBCBgCAg0ZAgJXAgQTiBcIDq8MjxEBAQEBAQEBAQEBAQEBAQEBGnuFF4F0gkaEBREBBoMYgToFh1SFV3Q9iDKFWYlpS4N5iFKOSgIeAQFCggMZgWYeLgEBAYcMNH4BAQE X-IronPort-AV: E=Sophos;i="5.22,524,1449550800"; d="scan'208";a="270296052" Received: from nipigon.cs.uoguelph.ca (HELO zcs1.mail.uoguelph.ca) ([131.104.99.173]) by esa-annu.net.uoguelph.ca with ESMTP; 01 Mar 2016 20:03:52 -0500 Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id DCAB315F55D; Tue, 1 Mar 2016 20:03:52 -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 ecdwE9WP9mWa; Tue, 1 Mar 2016 20:03:52 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by zcs1.mail.uoguelph.ca (Postfix) with ESMTP id 1AC9D15F565; Tue, 1 Mar 2016 20:03:52 -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 In4kA1axQUpe; Tue, 1 Mar 2016 20:03:52 -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 F379B15F55D; Tue, 1 Mar 2016 20:03:51 -0500 (EST) Date: Tue, 1 Mar 2016 20:03:51 -0500 (EST) From: Rick Macklem To: "Kenneth D. Merry" Cc: fs@freebsd.org, scsi@freebsd.org Message-ID: <2079334495.1177596.1456880631768.JavaMail.zimbra@uoguelph.ca> In-Reply-To: <20160301151109.GA79912@mithlond.kdm.org> References: <1740288370.14765302.1456790548437.JavaMail.zimbra@uoguelph.ca> <20160301151109.GA79912@mithlond.kdm.org> Subject: Re: FUSE extended attribute patches available MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.95.12] X-Mailer: Zimbra 8.0.9_GA_6191 (ZimbraWebClient - IE7 (Win)/8.0.9_GA_6191) Thread-Topic: FUSE extended attribute patches available Thread-Index: f0Y98rCs8CXfE8GZlh7LylfdvF2/qg== X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Mar 2016 01:04:01 -0000 Kenneth D. Merry wrote: > On Mon, Feb 29, 2016 at 19:02:28 -0500, Rick Macklem wrote: > > Ken Merry wrote: > > > I have patches for FreeBSD???s FUSE filesystem kernel module to support > > > extended attributes: > > > > > > https://people.freebsd.org/~ken/fuse_extattr.20160229.1.txt > > > > > > 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. > > I also have patches, although my list didn't work. (I didn't know that > > there was > > a difference between what Linux/FUSE returns vs what FreeBSD wanted. So now > > I know > > why my "list" didn't work.) > > Btw, when I discussed what to do w.r.t. extended attribute namespace, he > > seemed to > > think just considering all the fuse ones as User was ok. > > Ahh. Who is "he" in this context? > rwatson@ > It was easy enough to allow access to the user and system namespace. FUSE > and Linux use the same names, so might as well pass them through. The > other issue as far as FUSE goes, is that it is expecting the "user." or > "system." prefix on the attribute name. > Well, the extended attributes I am interested in are generated automagically by GlusterFS and they don't have a "user." or "system." prefix. For example: glusterfs.gfid This wouldn't work if fuse prepended the "user." or "system.". > FreeBSD passes those as a separate, numeric, argument in the VFS layer at > least, and expects to not see the namespace as a prefix when listing > attributes. > > > I also have patched FreeBSD's Fuse for the other stuff needed to export the > > fuse > > mount via an NFS server. (VFS_FHTOVP() etc) These aren't quite ready for > > "prime time" > > but if anyone wants to try them, just email me and I'll send you a copy. > > > > Btw, I have a couple of patches related to direct I/O and buffered I/O. You > > can > > find 2 of these at PR#206238. I also patched fuse_vnop_inactive() to > > flush/write > > dirty pages. (I think this is needed when an application mmaps a file and > > the > > modifies it after closing the file descriptor. I haven't actually tested to > > see > > if this fix is needed, so I haven't put it anywhere yet.) > > Ahh, cool! Now I can export a tape via NFS! :) > > Seriously, though, that will be helpful for some filesystems. > Btw, I have also done VOP_ADVLOCK(), since GlusterFS supports that. > > > For example: > > > > > > # 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 > > > > > > > > > Just to be clear on what this does, it only provides extended attribute > > > support to FreeBSD applications if the underlying FUSE filesystem > > > implements > > > FUSE extended attribute support. Many FUSE filesystems don???t support > > > the > > > extended attribute VFS operations. > > > > > > I have tested this out on IBM???s LTFS implementation, but I have not yet > > > found > > > another FUSE filesystem that supports extended attributes. If anyone > > > knows > > > of one, please let me know so I can try it out. (I looked through a > > > number > > > of the filesystems in sysutils/fusefs* in the ports tree.) > > > > > The FreeBSD GlusterFS port includes a fuse interface that supports extended > > attributes. That is how I tested what I have. (I think the port is now in > > svn, but if not you can find the GlusterFS port at PR#194409.) > > It glusterfs.org doc doesn't mention that you can create/test a volume of > > only one brick, but that works for trivial testing. If you decide to use it > > for testing and have trouble getting it going, just email. I know diddly > > about > > GlusterFS, but I have fired it up a few times. > > Ahh, that would be helpful. I'll give it a try. > > > > Any feedback is welcome. I???m planning to check this into FreeBSD/head > > > in the > > > next week or so. > > > > > I'll try to get around and taking a look to see if there is anything > > different > > than what I did (other than the above "list" case I didn't get right;-). > > Yes, it would be good to get another set of eyes. Perhaps the namespace > handling (user versus system) is different as well. > Yep, as above, the "namespace" is an issue. Have fun with it, rick > Ken > -- > Kenneth Merry > ken@FreeBSD.ORG >