diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-08-03 04:09:34 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-09-07 19:54:55 -0400 |
commit | 5d8943b04bab62614559f308b4e39533ca7f8e08 (patch) | |
tree | 150b0f5bd55517b16e346c17b5d234e20796d108 /fs/afs | |
parent | e7d33bb5ea82922e6ddcfc6b28a630b1a4ced071 (diff) |
afs: get rid of redundant ->d_name.len checks
No dentry can get to directory modification methods without
having passed either ->lookup() or ->atomic_open(); if name is
rejected by those two (or by ->d_hash()) with an error, it won't
be seen by anything else.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/afs')
-rw-r--r-- | fs/afs/dir.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/fs/afs/dir.c b/fs/afs/dir.c index 0b74d3176ab7..646337dc5201 100644 --- a/fs/afs/dir.c +++ b/fs/afs/dir.c | |||
@@ -751,10 +751,6 @@ static int afs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) | |||
751 | _enter("{%x:%u},{%s},%ho", | 751 | _enter("{%x:%u},{%s},%ho", |
752 | dvnode->fid.vid, dvnode->fid.vnode, dentry->d_name.name, mode); | 752 | dvnode->fid.vid, dvnode->fid.vnode, dentry->d_name.name, mode); |
753 | 753 | ||
754 | ret = -ENAMETOOLONG; | ||
755 | if (dentry->d_name.len >= AFSNAMEMAX) | ||
756 | goto error; | ||
757 | |||
758 | key = afs_request_key(dvnode->volume->cell); | 754 | key = afs_request_key(dvnode->volume->cell); |
759 | if (IS_ERR(key)) { | 755 | if (IS_ERR(key)) { |
760 | ret = PTR_ERR(key); | 756 | ret = PTR_ERR(key); |
@@ -816,10 +812,6 @@ static int afs_rmdir(struct inode *dir, struct dentry *dentry) | |||
816 | _enter("{%x:%u},{%s}", | 812 | _enter("{%x:%u},{%s}", |
817 | dvnode->fid.vid, dvnode->fid.vnode, dentry->d_name.name); | 813 | dvnode->fid.vid, dvnode->fid.vnode, dentry->d_name.name); |
818 | 814 | ||
819 | ret = -ENAMETOOLONG; | ||
820 | if (dentry->d_name.len >= AFSNAMEMAX) | ||
821 | goto error; | ||
822 | |||
823 | key = afs_request_key(dvnode->volume->cell); | 815 | key = afs_request_key(dvnode->volume->cell); |
824 | if (IS_ERR(key)) { | 816 | if (IS_ERR(key)) { |
825 | ret = PTR_ERR(key); | 817 | ret = PTR_ERR(key); |
@@ -936,10 +928,6 @@ static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode, | |||
936 | _enter("{%x:%u},{%s},%ho,", | 928 | _enter("{%x:%u},{%s},%ho,", |
937 | dvnode->fid.vid, dvnode->fid.vnode, dentry->d_name.name, mode); | 929 | dvnode->fid.vid, dvnode->fid.vnode, dentry->d_name.name, mode); |
938 | 930 | ||
939 | ret = -ENAMETOOLONG; | ||
940 | if (dentry->d_name.len >= AFSNAMEMAX) | ||
941 | goto error; | ||
942 | |||
943 | key = afs_request_key(dvnode->volume->cell); | 931 | key = afs_request_key(dvnode->volume->cell); |
944 | if (IS_ERR(key)) { | 932 | if (IS_ERR(key)) { |
945 | ret = PTR_ERR(key); | 933 | ret = PTR_ERR(key); |
@@ -1005,10 +993,6 @@ static int afs_link(struct dentry *from, struct inode *dir, | |||
1005 | dvnode->fid.vid, dvnode->fid.vnode, | 993 | dvnode->fid.vid, dvnode->fid.vnode, |
1006 | dentry->d_name.name); | 994 | dentry->d_name.name); |
1007 | 995 | ||
1008 | ret = -ENAMETOOLONG; | ||
1009 | if (dentry->d_name.len >= AFSNAMEMAX) | ||
1010 | goto error; | ||
1011 | |||
1012 | key = afs_request_key(dvnode->volume->cell); | 996 | key = afs_request_key(dvnode->volume->cell); |
1013 | if (IS_ERR(key)) { | 997 | if (IS_ERR(key)) { |
1014 | ret = PTR_ERR(key); | 998 | ret = PTR_ERR(key); |
@@ -1053,10 +1037,6 @@ static int afs_symlink(struct inode *dir, struct dentry *dentry, | |||
1053 | dvnode->fid.vid, dvnode->fid.vnode, dentry->d_name.name, | 1037 | dvnode->fid.vid, dvnode->fid.vnode, dentry->d_name.name, |
1054 | content); | 1038 | content); |
1055 | 1039 | ||
1056 | ret = -ENAMETOOLONG; | ||
1057 | if (dentry->d_name.len >= AFSNAMEMAX) | ||
1058 | goto error; | ||
1059 | |||
1060 | ret = -EINVAL; | 1040 | ret = -EINVAL; |
1061 | if (strlen(content) >= AFSPATHMAX) | 1041 | if (strlen(content) >= AFSPATHMAX) |
1062 | goto error; | 1042 | goto error; |
@@ -1127,10 +1107,6 @@ static int afs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1127 | new_dvnode->fid.vid, new_dvnode->fid.vnode, | 1107 | new_dvnode->fid.vid, new_dvnode->fid.vnode, |
1128 | new_dentry->d_name.name); | 1108 | new_dentry->d_name.name); |
1129 | 1109 | ||
1130 | ret = -ENAMETOOLONG; | ||
1131 | if (new_dentry->d_name.len >= AFSNAMEMAX) | ||
1132 | goto error; | ||
1133 | |||
1134 | key = afs_request_key(orig_dvnode->volume->cell); | 1110 | key = afs_request_key(orig_dvnode->volume->cell); |
1135 | if (IS_ERR(key)) { | 1111 | if (IS_ERR(key)) { |
1136 | ret = PTR_ERR(key); | 1112 | ret = PTR_ERR(key); |