diff options
Diffstat (limited to 'fs/nfsd/nfs4acl.c')
-rw-r--r-- | fs/nfsd/nfs4acl.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c index 649ad7cf2204..d3a587144222 100644 --- a/fs/nfsd/nfs4acl.c +++ b/fs/nfsd/nfs4acl.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/nfs_fs.h> | 38 | #include <linux/nfs_fs.h> |
39 | #include <linux/export.h> | 39 | #include <linux/export.h> |
40 | #include "nfsfh.h" | 40 | #include "nfsfh.h" |
41 | #include "nfsd.h" | ||
41 | #include "acl.h" | 42 | #include "acl.h" |
42 | #include "vfs.h" | 43 | #include "vfs.h" |
43 | 44 | ||
@@ -916,17 +917,22 @@ nfs4_acl_get_whotype(char *p, u32 len) | |||
916 | return NFS4_ACL_WHO_NAMED; | 917 | return NFS4_ACL_WHO_NAMED; |
917 | } | 918 | } |
918 | 919 | ||
919 | int | 920 | __be32 nfs4_acl_write_who(int who, __be32 **p, int *len) |
920 | nfs4_acl_write_who(int who, char *p) | ||
921 | { | 921 | { |
922 | int i; | 922 | int i; |
923 | int bytes; | ||
923 | 924 | ||
924 | for (i = 0; i < ARRAY_SIZE(s2t_map); i++) { | 925 | for (i = 0; i < ARRAY_SIZE(s2t_map); i++) { |
925 | if (s2t_map[i].type == who) { | 926 | if (s2t_map[i].type != who) |
926 | memcpy(p, s2t_map[i].string, s2t_map[i].stringlen); | 927 | continue; |
927 | return s2t_map[i].stringlen; | 928 | bytes = 4 + (XDR_QUADLEN(s2t_map[i].stringlen) << 2); |
928 | } | 929 | if (bytes > *len) |
930 | return nfserr_resource; | ||
931 | *p = xdr_encode_opaque(*p, s2t_map[i].string, | ||
932 | s2t_map[i].stringlen); | ||
933 | *len -= bytes; | ||
934 | return 0; | ||
929 | } | 935 | } |
930 | BUG(); | 936 | WARN_ON_ONCE(1); |
931 | return -1; | 937 | return -1; |
932 | } | 938 | } |