From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vyacheslav Dubeyko Subject: Re: [PATCH 21/21] hfsplus: remove can_set_xattr Date: Thu, 26 Dec 2013 14:15:49 +0400 Message-ID: <1388052949.4168.91.camel@slavad-ubuntu> 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> Reply-To: slava@dubeyko.com Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org To: Christoph Hellwig Return-path: Received: from oproxy19-pub.mail.unifiedlayer.com ([70.40.200.33]:56207 "HELO oproxy19-pub.mail.unifiedlayer.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1750713Ab3LZKPy (ORCPT ); Thu, 26 Dec 2013 05:15:54 -0500 In-Reply-To: <20131226094853.GA27078@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, 2013-12-26 at 01:48 -0800, Christoph Hellwig wrote: > On Tue, Dec 24, 2013 at 10:41:44AM +0400, Vyacheslav Dubeyko wrote: > > > - > > > - if (strncmp(name, XATTR_MAC_OSX_PREFIX, > > > - XATTR_MAC_OSX_PREFIX_LEN) == 0) > > > - name += XATTR_MAC_OSX_PREFIX_LEN; > > > > Removing this skipping of virtual "osx." prefix means that you save it > > on volume. But such action means volume corruption really. Because HFS+ > > volume hasn't such prefixes for xattrs in AttributesFile. Usually, > > special xattrs has prefix "com.apple.*" but others haven't any prefix > > and can be named as you want. So, I think that it is not correct > > modification. > > With my patch applied we don't add the prefix that later gets stripped > in the first place: > > - hfsplus_osx_setxattr gets called without the prefix from the VFS code > - the code to add the prefix in hfsplus_osx_setxattr is removed by the > patch > - the code to remove it again in __hfsplus_setxattr is removed as well > > Because of the way the handlers work no other caller of > __hfsplus_setxattr should ever have a name with the osx prefix. > > Same for the getxattr side. I feel some confusion. :) As far as I can see, generic handlers are connected with a prefix: const struct xattr_handler hfsplus_xattr_osx_handler = { .prefix = XATTR_MAC_OSX_PREFIX, .list = hfsplus_osx_listxattr, .get = hfsplus_osx_getxattr, .set = hfsplus_osx_setxattr, }; 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? With the best regards, Vyacheslav Dubeyko.