diff options
author | Christoph Hellwig <hch@infradead.org> | 2014-01-30 09:01:52 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-30 12:37:49 -0500 |
commit | 5f13ee9c1ce87b3c99928ab33ef43a2c0d3fd220 (patch) | |
tree | 4f40ff795f8e23212f0a93f0ebf8345c34347edb /fs/nfs/nfs3proc.c | |
parent | 9b0cd304f26b9fca140de15deeac2bf357d1f388 (diff) |
nfs: fix xattr inode op pointers when disabled
Chris Mason reported a NULL pointer derefernence in generic_getxattr()
that was due to sb->s_xattr being NULL.
The reason is that the nfs #ifdef's for ACL support were misplaced, and
the nfs3 inode operations had the xattr operation pointers set up, even
though xattrs were not actually supported. As a result, the xattr code
was being called without the infrastructure having been set up.
Move the #ifdef's appropriately.
Reported-and-tested-by: Chris Mason <clm@fb.com>
Acked-by: Al Viro viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nfs/nfs3proc.c')
-rw-r--r-- | fs/nfs/nfs3proc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index d2255d705421..aa9bc973f36a 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c | |||
@@ -924,11 +924,11 @@ static const struct inode_operations nfs3_dir_inode_operations = { | |||
924 | .permission = nfs_permission, | 924 | .permission = nfs_permission, |
925 | .getattr = nfs_getattr, | 925 | .getattr = nfs_getattr, |
926 | .setattr = nfs_setattr, | 926 | .setattr = nfs_setattr, |
927 | #ifdef CONFIG_NFS_V3_ACL | ||
927 | .listxattr = generic_listxattr, | 928 | .listxattr = generic_listxattr, |
928 | .getxattr = generic_getxattr, | 929 | .getxattr = generic_getxattr, |
929 | .setxattr = generic_setxattr, | 930 | .setxattr = generic_setxattr, |
930 | .removexattr = generic_removexattr, | 931 | .removexattr = generic_removexattr, |
931 | #ifdef CONFIG_NFS_V3_ACL | ||
932 | .get_acl = nfs3_get_acl, | 932 | .get_acl = nfs3_get_acl, |
933 | .set_acl = nfs3_set_acl, | 933 | .set_acl = nfs3_set_acl, |
934 | #endif | 934 | #endif |
@@ -938,11 +938,11 @@ static const struct inode_operations nfs3_file_inode_operations = { | |||
938 | .permission = nfs_permission, | 938 | .permission = nfs_permission, |
939 | .getattr = nfs_getattr, | 939 | .getattr = nfs_getattr, |
940 | .setattr = nfs_setattr, | 940 | .setattr = nfs_setattr, |
941 | #ifdef CONFIG_NFS_V3_ACL | ||
941 | .listxattr = generic_listxattr, | 942 | .listxattr = generic_listxattr, |
942 | .getxattr = generic_getxattr, | 943 | .getxattr = generic_getxattr, |
943 | .setxattr = generic_setxattr, | 944 | .setxattr = generic_setxattr, |
944 | .removexattr = generic_removexattr, | 945 | .removexattr = generic_removexattr, |
945 | #ifdef CONFIG_NFS_V3_ACL | ||
946 | .get_acl = nfs3_get_acl, | 946 | .get_acl = nfs3_get_acl, |
947 | .set_acl = nfs3_set_acl, | 947 | .set_acl = nfs3_set_acl, |
948 | #endif | 948 | #endif |