aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/dir.c
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2006-01-06 03:19:40 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 11:33:56 -0500
commit1d3d752b471d2a3a1d5e4fe177e5e7d52abb4e4c (patch)
tree05c6c99ca02118e2c80199c36f4f6263cdf7986b /fs/fuse/dir.c
parent248d86e87d12da19eee602075f05a49a5215288b (diff)
[PATCH] fuse: clean up request size limit checking
Change the way a too large request is handled. Until now in this case the device read returned -EINVAL and the operation returned -EIO. Make it more flexibible by not returning -EINVAL from the read, but restarting it instead. Also remove the fixed limit on setxattr data and let the filesystem provide as large a read buffer as it needs to handle the extended attribute data. The symbolic link length is already checked by VFS to be less than PATH_MAX, so the extra check against FUSE_SYMLINK_MAX is not needed. The check in fuse_create_open() against FUSE_NAME_MAX is not needed, since the dentry has already been looked up, and hence the name already checked. Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/fuse/dir.c')
-rw-r--r--fs/fuse/dir.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 9a6075de961f..f156392d019e 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -236,10 +236,6 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry, int mode,
236 if (fc->no_create) 236 if (fc->no_create)
237 goto out; 237 goto out;
238 238
239 err = -ENAMETOOLONG;
240 if (entry->d_name.len > FUSE_NAME_MAX)
241 goto out;
242
243 err = -EINTR; 239 err = -EINTR;
244 req = fuse_get_request(fc); 240 req = fuse_get_request(fc);
245 if (!req) 241 if (!req)
@@ -413,12 +409,7 @@ static int fuse_symlink(struct inode *dir, struct dentry *entry,
413{ 409{
414 struct fuse_conn *fc = get_fuse_conn(dir); 410 struct fuse_conn *fc = get_fuse_conn(dir);
415 unsigned len = strlen(link) + 1; 411 unsigned len = strlen(link) + 1;
416 struct fuse_req *req; 412 struct fuse_req *req = fuse_get_request(fc);
417
418 if (len > FUSE_SYMLINK_MAX)
419 return -ENAMETOOLONG;
420
421 req = fuse_get_request(fc);
422 if (!req) 413 if (!req)
423 return -EINTR; 414 return -EINTR;
424 415
@@ -988,9 +979,6 @@ static int fuse_setxattr(struct dentry *entry, const char *name,
988 struct fuse_setxattr_in inarg; 979 struct fuse_setxattr_in inarg;
989 int err; 980 int err;
990 981
991 if (size > FUSE_XATTR_SIZE_MAX)
992 return -E2BIG;
993
994 if (fc->no_setxattr) 982 if (fc->no_setxattr)
995 return -EOPNOTSUPP; 983 return -EOPNOTSUPP;
996 984