From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH v2 6/7] squashfs: xattr simplifications Date: Sat, 3 Oct 2015 23:29:06 -0700 Message-ID: <20151004062906.GE28519@infradead.org> References: <1442924812-9384-1-git-send-email-agruenba@redhat.com> <1442924812-9384-7-git-send-email-agruenba@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Alexander Viro , Christoph Hellwig , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Phillip Lougher To: Andreas Gruenbacher Return-path: Received: from bombadil.infradead.org ([198.137.202.9]:36865 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751208AbbJDG3H (ORCPT ); Sun, 4 Oct 2015 02:29:07 -0400 Content-Disposition: inline In-Reply-To: <1442924812-9384-7-git-send-email-agruenba@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Sep 22, 2015 at 02:26:51PM +0200, Andreas Gruenbacher wrote: > Now that the xattr handler is passed to the xattr handler operations, we > have access to the attribute name prefix, so simplify the squashfs xattr > handlers a bit. > > Signed-off-by: Andreas Gruenbacher > --- > fs/squashfs/xattr.c | 90 ++++++++++++++++++----------------------------------- > 1 file changed, 31 insertions(+), 59 deletions(-) > > diff --git a/fs/squashfs/xattr.c b/fs/squashfs/xattr.c > index 4ae1e4f..6a4cc34 100644 > --- a/fs/squashfs/xattr.c > +++ b/fs/squashfs/xattr.c > @@ -212,96 +212,68 @@ failed: > } > > > -/* > - * User namespace support > - */ > -static size_t squashfs_user_list(const struct xattr_handler *handler, > - struct dentry *d, char *list, size_t list_size, > - const char *name, size_t name_len) > +static size_t squashfs_xattr_handler_list(const struct xattr_handler *handler, > + struct dentry *d, char *list, > + size_t list_size, const char *name, > + size_t name_len) > { > - if (list && XATTR_USER_PREFIX_LEN <= list_size) > - memcpy(list, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN); > - return XATTR_USER_PREFIX_LEN; > + int len = strlen(handler->prefix); > + > + if (list && len <= list_size) > + memcpy(list, handler->prefix, len); > + return len; IS it just me or is this handler broke before and after this patch? It only copies out the prefix, but not the actual xattr name.