From patchwork Fri Sep 4 11:57:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Andreas_Gr=C3=BCnbacher?= X-Patchwork-Id: 7121611 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D7003BEEC1 for ; Fri, 4 Sep 2015 11:59:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F3DA92071B for ; Fri, 4 Sep 2015 11:59:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 01D0E2079F for ; Fri, 4 Sep 2015 11:59:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758811AbbIDL6f (ORCPT ); Fri, 4 Sep 2015 07:58:35 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:33230 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758036AbbIDL5c (ORCPT ); Fri, 4 Sep 2015 07:57:32 -0400 Received: by wiclk2 with SMTP id lk2so20128392wic.0; Fri, 04 Sep 2015 04:57:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=VmchmGLU2BVKPv7hbCdcGG3CUEtkePWTvSZsmLzNN3s=; b=zaO31mIUrnDj74v6dscBR4XDJS4lViyOl+o/1hjqs03b0mCSuALuukQpABdEFUrt2M wyCdRp94GeWHoRbcfUOONfAVWgq20SJFPUlB58WltQeUERTypJvT2J9hYd6LLecW4KKo elfYwQXcWoepoHY8ZvTFSyxm+GQw4e8bShsn6NwYuSpkVsF8CDSFIk/4SbthRWl9OTuq F2z6rojubbKKZKDoAZ9wyeOQ1KzgxizSVMmaNxYNX54HUhX73Ho0Dtn9FWJyedlrfrQ9 xFfq0aPV45vfGxhXUeh5rkGmyPVxh2jhXa2cCH8hV/BhJR4Cmaaao8qNtellI41XTo4q 5GAw== X-Received: by 10.194.123.4 with SMTP id lw4mr6463284wjb.94.1441367850919; Fri, 04 Sep 2015 04:57:30 -0700 (PDT) Received: from nuc.lan ([95.91.235.105]) by smtp.gmail.com with ESMTPSA id op6sm3940943wic.12.2015.09.04.04.57.29 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Sep 2015 04:57:29 -0700 (PDT) From: Andreas Gruenbacher X-Google-Original-From: Andreas Gruenbacher To: Alexander Viro , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Artem Bityutskiy , Adrian Hunter , linux-mtd@lists.infradead.org, Richard Weinberger , Eric Van Hensbergen , Ron Minnich , Latchesar Ionkov , v9fs-developer@lists.sourceforge.net Subject: [PATCH 1/5] ubifs: Remove unused "security.*" xattr handler Date: Fri, 4 Sep 2015 13:57:18 +0200 Message-Id: <1441367842-25079-2-git-send-email-agruenba@redhat.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1441367842-25079-1-git-send-email-agruenba@redhat.com> References: <1441367842-25079-1-git-send-email-agruenba@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Ubifs installs a "security.*" xattr handler in sb->s_xattr but doesn't use the generic_{get,set,list,remove}xattr inode operations needed for processing this list of attribute handlers; the handler is never called. Instead, ubifs uses its own xattr handlers which also process "security.*" xattrs. Remove the dead code. Signed-off-by: Andreas Gruenbacher --- fs/ubifs/super.c | 1 - fs/ubifs/ubifs.h | 1 - fs/ubifs/xattr.c | 40 ---------------------------------------- 3 files changed, 42 deletions(-) diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 9547a278..c71edca 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -2037,7 +2037,6 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent) if (c->max_inode_sz > MAX_LFS_FILESIZE) sb->s_maxbytes = c->max_inode_sz = MAX_LFS_FILESIZE; sb->s_op = &ubifs_super_operations; - sb->s_xattr = ubifs_xattr_handlers; mutex_lock(&c->umount_mutex); err = mount_ubifs(c); diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index de75902..33b6ee7 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h @@ -1470,7 +1470,6 @@ extern spinlock_t ubifs_infos_lock; extern atomic_long_t ubifs_clean_zn_cnt; extern struct kmem_cache *ubifs_inode_slab; extern const struct super_operations ubifs_super_operations; -extern const struct xattr_handler *ubifs_xattr_handlers[]; extern const struct address_space_operations ubifs_file_address_operations; extern const struct file_operations ubifs_file_operations; extern const struct inode_operations ubifs_file_inode_operations; diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c index 96f3448..b512b14 100644 --- a/fs/ubifs/xattr.c +++ b/fs/ubifs/xattr.c @@ -582,46 +582,6 @@ out_free: return err; } -static size_t security_listxattr(struct dentry *d, char *list, size_t list_size, - const char *name, size_t name_len, int flags) -{ - const int prefix_len = XATTR_SECURITY_PREFIX_LEN; - const size_t total_len = prefix_len + name_len + 1; - - if (list && total_len <= list_size) { - memcpy(list, XATTR_SECURITY_PREFIX, prefix_len); - memcpy(list + prefix_len, name, name_len); - list[prefix_len + name_len] = '\0'; - } - - return total_len; -} - -static int security_getxattr(struct dentry *d, const char *name, void *buffer, - size_t size, int flags) -{ - return ubifs_getxattr(d, name, buffer, size); -} - -static int security_setxattr(struct dentry *d, const char *name, - const void *value, size_t size, int flags, - int handler_flags) -{ - return ubifs_setxattr(d, name, value, size, flags); -} - -static const struct xattr_handler ubifs_xattr_security_handler = { - .prefix = XATTR_SECURITY_PREFIX, - .list = security_listxattr, - .get = security_getxattr, - .set = security_setxattr, -}; - -const struct xattr_handler *ubifs_xattr_handlers[] = { - &ubifs_xattr_security_handler, - NULL, -}; - static int init_xattrs(struct inode *inode, const struct xattr *xattr_array, void *fs_info) {