From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 21/21] hfsplus: remove can_set_xattr Date: Thu, 26 Dec 2013 02:45:32 -0800 Message-ID: <20131226104532.GA11456@infradead.org> References: <20131220131635.650823732@bombadil.infradead.org> <20131220132524.900291394@bombadil.infradead.org> <636E01BC-12FD-452B-8B1C-320B6EADAEFD@dubeyko.com> <20131222192818.GA32565@infradead.org> <1387780809.3991.21.camel@slavad-ubuntu> <20131223143706.GA8235@infradead.org> <1387867304.3974.21.camel@slavad-ubuntu> <20131226094853.GA27078@infradead.org> <1388052949.4168.91.camel@slavad-ubuntu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Christoph Hellwig , viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org To: Vyacheslav Dubeyko Return-path: Received: from bombadil.infradead.org ([198.137.202.9]:44285 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751831Ab3LZKpf (ORCPT ); Thu, 26 Dec 2013 05:45:35 -0500 Content-Disposition: inline In-Reply-To: <1388052949.4168.91.camel@slavad-ubuntu> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Dec 26, 2013 at 02:15:49PM +0400, Vyacheslav Dubeyko wrote: > So, if we don't add the "osx." prefix on the fly then it means that we > don't call proper handler. HFS+ doesn't keep "osx." prefix on the volume > because this prefix is Linux way only to process xattrs. For example, I > can create xattr with name "test" under Mac OS X. And this xattr's name > hasn't "osx." prefix. Can I access to this xattr under Linux if we don't > add "osx." prefix on the fly? > > Maybe I misunderstand some part of your patch set? Most filesystems don't store the prefix on disk, but instead a binary namespace, that's why the handler code strips it (although we might want to eventually add a flag to not strip it given that we have a few filesystems storing it now). So let's look at the case of a fgetxattr(fd, "osx.foo", ...) with the old and my new code. Old: \--- sys_fgetxattr(fd, "osx.foo", .... \ ... \--- generic_getxattr(dentry, "osx.foo", ... \ [xattr_resolve_name strips the prefix] \--- hfsplus_osx_getxattr(dentry, "foo", ... \ [adds back prefix] \ ... \--- __hfsplus_getxattr(dentry, "osx.foo", ... \ [strips the prefix again] \--- hfsplus_find_attr(sb, ino, "foo", ... New: \--- sys_fgetxattr(fd, "osx.foo", .... \ ... \--- generic_getxattr(dentry, "osx.foo", ... \ [xattr_resolve_name strips the prefix] \--- hfsplus_osx_getxattr(dentry, "foo", ... \ ... \--- __hfsplus_getxattr(dentry, "foo", ... \--- hfsplus_find_attr(sb, ino, "foo", ...