public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nfs: avoid oops when CONFIG_NFS_V3_ACL is not set
@ 2014-01-30 14:35 Christoph Hellwig
  0 siblings, 0 replies; only message in thread
From: Christoph Hellwig @ 2014-01-30 14:35 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: viro, Chris Mason, linux-nfs

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: [<ffffffff811ab510>] generic_getxattr+0x20/0x90
[  198.595266] PGD baaf2067 PUD ba4f4067 PMD 0
[  198.605033] Oops: 0000 [#1] SMP


Signed-off-by: Christoph Hellwig <hch@lst.de>
Reported-by: Chris Mason <clm@fb.com>
Tested-by: Chris Mason <clm@fb.com>

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-01-30 14:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-30 14:35 [PATCH] nfs: avoid oops when CONFIG_NFS_V3_ACL is not set Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox