Lines Matching refs:error
96 int error = -EOPNOTSUPP; in __vfs_setxattr_noperm() local
103 error = inode->i_op->setxattr(dentry, name, value, size, flags); in __vfs_setxattr_noperm()
104 if (!error) { in __vfs_setxattr_noperm()
111 error = security_inode_setsecurity(inode, suffix, value, in __vfs_setxattr_noperm()
113 if (!error) in __vfs_setxattr_noperm()
117 return error; in __vfs_setxattr_noperm()
126 int error; in vfs_setxattr() local
128 error = xattr_permission(inode, name, MAY_WRITE); in vfs_setxattr()
129 if (error) in vfs_setxattr()
130 return error; in vfs_setxattr()
133 error = security_inode_setxattr(dentry, name, value, size, flags); in vfs_setxattr()
134 if (error) in vfs_setxattr()
137 error = __vfs_setxattr_noperm(dentry, name, value, size, flags); in vfs_setxattr()
141 return error; in vfs_setxattr()
186 int error; in vfs_getxattr_alloc() local
188 error = xattr_permission(inode, name, MAY_READ); in vfs_getxattr_alloc()
189 if (error) in vfs_getxattr_alloc()
190 return error; in vfs_getxattr_alloc()
195 error = inode->i_op->getxattr(dentry, name, NULL, 0); in vfs_getxattr_alloc()
196 if (error < 0) in vfs_getxattr_alloc()
197 return error; in vfs_getxattr_alloc()
199 if (!value || (error > xattr_size)) { in vfs_getxattr_alloc()
200 value = krealloc(*xattr_value, error + 1, flags); in vfs_getxattr_alloc()
203 memset(value, 0, error + 1); in vfs_getxattr_alloc()
206 error = inode->i_op->getxattr(dentry, name, value, error); in vfs_getxattr_alloc()
208 return error; in vfs_getxattr_alloc()
234 int error; in vfs_getxattr() local
236 error = xattr_permission(inode, name, MAY_READ); in vfs_getxattr()
237 if (error) in vfs_getxattr()
238 return error; in vfs_getxattr()
240 error = security_inode_getxattr(dentry, name); in vfs_getxattr()
241 if (error) in vfs_getxattr()
242 return error; in vfs_getxattr()
258 error = inode->i_op->getxattr(dentry, name, value, size); in vfs_getxattr()
260 error = -EOPNOTSUPP; in vfs_getxattr()
262 return error; in vfs_getxattr()
269 ssize_t error; in vfs_listxattr() local
271 error = security_inode_listxattr(d); in vfs_listxattr()
272 if (error) in vfs_listxattr()
273 return error; in vfs_listxattr()
274 error = -EOPNOTSUPP; in vfs_listxattr()
276 error = d->d_inode->i_op->listxattr(d, list, size); in vfs_listxattr()
278 error = security_inode_listsecurity(d->d_inode, list, size); in vfs_listxattr()
279 if (size && error > size) in vfs_listxattr()
280 error = -ERANGE; in vfs_listxattr()
282 return error; in vfs_listxattr()
290 int error; in vfs_removexattr() local
295 error = xattr_permission(inode, name, MAY_WRITE); in vfs_removexattr()
296 if (error) in vfs_removexattr()
297 return error; in vfs_removexattr()
300 error = security_inode_removexattr(dentry, name); in vfs_removexattr()
301 if (error) in vfs_removexattr()
304 error = inode->i_op->removexattr(dentry, name); in vfs_removexattr()
306 if (!error) { in vfs_removexattr()
313 return error; in vfs_removexattr()
325 int error; in setxattr() local
333 error = strncpy_from_user(kname, name, sizeof(kname)); in setxattr()
334 if (error == 0 || error == sizeof(kname)) in setxattr()
335 error = -ERANGE; in setxattr()
336 if (error < 0) in setxattr()
337 return error; in setxattr()
350 error = -EFAULT; in setxattr()
358 error = vfs_setxattr(d, kname, kvalue, size, flags); in setxattr()
364 return error; in setxattr()
372 int error; in path_setxattr() local
374 error = user_path_at(AT_FDCWD, pathname, lookup_flags, &path); in path_setxattr()
375 if (error) in path_setxattr()
376 return error; in path_setxattr()
377 error = mnt_want_write(path.mnt); in path_setxattr()
378 if (!error) { in path_setxattr()
379 error = setxattr(path.dentry, name, value, size, flags); in path_setxattr()
383 if (retry_estale(error, lookup_flags)) { in path_setxattr()
387 return error; in path_setxattr()
408 int error = -EBADF; in SYSCALL_DEFINE5() local
411 return error; in SYSCALL_DEFINE5()
413 error = mnt_want_write_file(f.file); in SYSCALL_DEFINE5()
414 if (!error) { in SYSCALL_DEFINE5()
415 error = setxattr(f.file->f_path.dentry, name, value, size, flags); in SYSCALL_DEFINE5()
419 return error; in SYSCALL_DEFINE5()
429 ssize_t error; in getxattr() local
434 error = strncpy_from_user(kname, name, sizeof(kname)); in getxattr()
435 if (error == 0 || error == sizeof(kname)) in getxattr()
436 error = -ERANGE; in getxattr()
437 if (error < 0) in getxattr()
438 return error; in getxattr()
452 error = vfs_getxattr(d, kname, kvalue, size); in getxattr()
453 if (error > 0) { in getxattr()
457 if (size && copy_to_user(value, kvalue, error)) in getxattr()
458 error = -EFAULT; in getxattr()
459 } else if (error == -ERANGE && size >= XATTR_SIZE_MAX) { in getxattr()
462 error = -E2BIG; in getxattr()
468 return error; in getxattr()
476 ssize_t error; in path_getxattr() local
478 error = user_path_at(AT_FDCWD, pathname, lookup_flags, &path); in path_getxattr()
479 if (error) in path_getxattr()
480 return error; in path_getxattr()
481 error = getxattr(path.dentry, name, value, size); in path_getxattr()
483 if (retry_estale(error, lookup_flags)) { in path_getxattr()
487 return error; in path_getxattr()
506 ssize_t error = -EBADF; in SYSCALL_DEFINE4() local
509 return error; in SYSCALL_DEFINE4()
511 error = getxattr(f.file->f_path.dentry, name, value, size); in SYSCALL_DEFINE4()
513 return error; in SYSCALL_DEFINE4()
522 ssize_t error; in listxattr() local
538 error = vfs_listxattr(d, klist, size); in listxattr()
539 if (error > 0) { in listxattr()
540 if (size && copy_to_user(list, klist, error)) in listxattr()
541 error = -EFAULT; in listxattr()
542 } else if (error == -ERANGE && size >= XATTR_LIST_MAX) { in listxattr()
545 error = -E2BIG; in listxattr()
551 return error; in listxattr()
558 ssize_t error; in path_listxattr() local
560 error = user_path_at(AT_FDCWD, pathname, lookup_flags, &path); in path_listxattr()
561 if (error) in path_listxattr()
562 return error; in path_listxattr()
563 error = listxattr(path.dentry, list, size); in path_listxattr()
565 if (retry_estale(error, lookup_flags)) { in path_listxattr()
569 return error; in path_listxattr()
587 ssize_t error = -EBADF; in SYSCALL_DEFINE3() local
590 return error; in SYSCALL_DEFINE3()
592 error = listxattr(f.file->f_path.dentry, list, size); in SYSCALL_DEFINE3()
594 return error; in SYSCALL_DEFINE3()
603 int error; in removexattr() local
606 error = strncpy_from_user(kname, name, sizeof(kname)); in removexattr()
607 if (error == 0 || error == sizeof(kname)) in removexattr()
608 error = -ERANGE; in removexattr()
609 if (error < 0) in removexattr()
610 return error; in removexattr()
619 int error; in path_removexattr() local
621 error = user_path_at(AT_FDCWD, pathname, lookup_flags, &path); in path_removexattr()
622 if (error) in path_removexattr()
623 return error; in path_removexattr()
624 error = mnt_want_write(path.mnt); in path_removexattr()
625 if (!error) { in path_removexattr()
626 error = removexattr(path.dentry, name); in path_removexattr()
630 if (retry_estale(error, lookup_flags)) { in path_removexattr()
634 return error; in path_removexattr()
652 int error = -EBADF; in SYSCALL_DEFINE2() local
655 return error; in SYSCALL_DEFINE2()
657 error = mnt_want_write_file(f.file); in SYSCALL_DEFINE2()
658 if (!error) { in SYSCALL_DEFINE2()
659 error = removexattr(f.file->f_path.dentry, name); in SYSCALL_DEFINE2()
663 return error; in SYSCALL_DEFINE2()