nfs: avoid oops when CONFIG_NFS_V3_ACL is not set
Subsystems (2)
PATCH 1/1 nfs: avoid oops when CONFIG_NFS_V3_ACL is not set
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 <[email protected]>
Reported-by Chris Mason <[email protected]>
Tested-by Chris Mason <[email protected]>
fs/nfs/nfs3proc.c +2 -2
@@ -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