From patchwork Thu Jan 30 14:35:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 3557471 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6337FC02DC for ; Thu, 30 Jan 2014 14:35:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 536BF2017E for ; Thu, 30 Jan 2014 14:35:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3F31920161 for ; Thu, 30 Jan 2014 14:35:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753059AbaA3OfY (ORCPT ); Thu, 30 Jan 2014 09:35:24 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:52109 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753237AbaA3OfV (ORCPT ); Thu, 30 Jan 2014 09:35:21 -0500 Received: from hch by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1W8si6-0004jG-Hh; Thu, 30 Jan 2014 14:35:18 +0000 Date: Thu, 30 Jan 2014 06:35:18 -0800 From: Christoph Hellwig To: Trond Myklebust Cc: viro@zeniv.linux.org.uk, Chris Mason , linux-nfs@vger.kernel.org Subject: [PATCH] nfs: avoid oops when CONFIG_NFS_V3_ACL is not set Message-ID: <20140130143518.GA14169@infradead.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 If we don't have s_xattr set we must not call the generic xattr inode operations: [ 198.564281] BUG: unable to handle kernel NULL pointer dereference at +(null) [ 198.581957] IP: [] generic_getxattr+0x20/0x90 [ 198.595266] PGD baaf2067 PUD ba4f4067 PMD 0 [ 198.605033] Oops: 0000 [#1] SMP Signed-off-by: Christoph Hellwig Reported-by: Chris Mason Tested-by: Chris Mason --- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index d2255d7..aa9bc97 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c @@ -924,11 +924,11 @@ static const struct inode_operations nfs3_dir_inode_operations = { .permission = nfs_permission, .getattr = nfs_getattr, .setattr = nfs_setattr, +#ifdef CONFIG_NFS_V3_ACL .listxattr = generic_listxattr, .getxattr = generic_getxattr, .setxattr = generic_setxattr, .removexattr = generic_removexattr, -#ifdef CONFIG_NFS_V3_ACL .get_acl = nfs3_get_acl, .set_acl = nfs3_set_acl, #endif @@ -938,11 +938,11 @@ static const struct inode_operations nfs3_file_inode_operations = { .permission = nfs_permission, .getattr = nfs_getattr, .setattr = nfs_setattr, +#ifdef CONFIG_NFS_V3_ACL .listxattr = generic_listxattr, .getxattr = generic_getxattr, .setxattr = generic_setxattr, .removexattr = generic_removexattr, -#ifdef CONFIG_NFS_V3_ACL .get_acl = nfs3_get_acl, .set_acl = nfs3_set_acl, #endif