Lines Matching refs:error

174 	int error = -EAGAIN;  in __vfs_setxattr_noperm()  local
181 error = __vfs_setxattr(dentry, inode, name, value, size, flags); in __vfs_setxattr_noperm()
182 if (!error) { in __vfs_setxattr_noperm()
191 if (error == -EAGAIN) { in __vfs_setxattr_noperm()
192 error = -EOPNOTSUPP; in __vfs_setxattr_noperm()
197 error = security_inode_setsecurity(inode, suffix, value, in __vfs_setxattr_noperm()
199 if (!error) in __vfs_setxattr_noperm()
204 return error; in __vfs_setxattr_noperm()
213 int error; in vfs_setxattr() local
215 error = xattr_permission(inode, name, MAY_WRITE); in vfs_setxattr()
216 if (error) in vfs_setxattr()
217 return error; in vfs_setxattr()
220 error = security_inode_setxattr(dentry, name, value, size, flags); in vfs_setxattr()
221 if (error) in vfs_setxattr()
224 error = __vfs_setxattr_noperm(dentry, name, value, size, flags); in vfs_setxattr()
228 return error; in vfs_setxattr()
273 int error; in vfs_getxattr_alloc() local
275 error = xattr_permission(inode, name, MAY_READ); in vfs_getxattr_alloc()
276 if (error) in vfs_getxattr_alloc()
277 return error; in vfs_getxattr_alloc()
284 error = handler->get(handler, dentry, inode, name, NULL, 0); in vfs_getxattr_alloc()
285 if (error < 0) in vfs_getxattr_alloc()
286 return error; in vfs_getxattr_alloc()
288 if (!value || (error > xattr_size)) { in vfs_getxattr_alloc()
289 value = krealloc(*xattr_value, error + 1, flags); in vfs_getxattr_alloc()
292 memset(value, 0, error + 1); in vfs_getxattr_alloc()
295 error = handler->get(handler, dentry, inode, name, value, error); in vfs_getxattr_alloc()
297 return error; in vfs_getxattr_alloc()
319 int error; in vfs_getxattr() local
321 error = xattr_permission(inode, name, MAY_READ); in vfs_getxattr()
322 if (error) in vfs_getxattr()
323 return error; in vfs_getxattr()
325 error = security_inode_getxattr(dentry, name); in vfs_getxattr()
326 if (error) in vfs_getxattr()
327 return error; in vfs_getxattr()
350 ssize_t error; in vfs_listxattr() local
352 error = security_inode_listxattr(dentry); in vfs_listxattr()
353 if (error) in vfs_listxattr()
354 return error; in vfs_listxattr()
356 error = inode->i_op->listxattr(dentry, list, size); in vfs_listxattr()
358 error = security_inode_listsecurity(inode, list, size); in vfs_listxattr()
359 if (size && error > size) in vfs_listxattr()
360 error = -ERANGE; in vfs_listxattr()
362 return error; in vfs_listxattr()
385 int error; in vfs_removexattr() local
387 error = xattr_permission(inode, name, MAY_WRITE); in vfs_removexattr()
388 if (error) in vfs_removexattr()
389 return error; in vfs_removexattr()
392 error = security_inode_removexattr(dentry, name); in vfs_removexattr()
393 if (error) in vfs_removexattr()
396 error = __vfs_removexattr(dentry, name); in vfs_removexattr()
398 if (!error) { in vfs_removexattr()
405 return error; in vfs_removexattr()
417 int error; in setxattr() local
424 error = strncpy_from_user(kname, name, sizeof(kname)); in setxattr()
425 if (error == 0 || error == sizeof(kname)) in setxattr()
426 error = -ERANGE; in setxattr()
427 if (error < 0) in setxattr()
428 return error; in setxattr()
437 error = -EFAULT; in setxattr()
444 error = cap_convert_nscap(d, &kvalue, size); in setxattr()
445 if (error < 0) in setxattr()
447 size = error; in setxattr()
451 error = vfs_setxattr(d, kname, kvalue, size, flags); in setxattr()
455 return error; in setxattr()
463 int error; in path_setxattr() local
465 error = user_path_at(AT_FDCWD, pathname, lookup_flags, &path); in path_setxattr()
466 if (error) in path_setxattr()
467 return error; in path_setxattr()
468 error = mnt_want_write(path.mnt); in path_setxattr()
469 if (!error) { in path_setxattr()
470 error = setxattr(path.dentry, name, value, size, flags); in path_setxattr()
474 if (retry_estale(error, lookup_flags)) { in path_setxattr()
478 return error; in path_setxattr()
499 int error = -EBADF; in SYSCALL_DEFINE5() local
502 return error; in SYSCALL_DEFINE5()
504 error = mnt_want_write_file(f.file); in SYSCALL_DEFINE5()
505 if (!error) { in SYSCALL_DEFINE5()
506 error = setxattr(f.file->f_path.dentry, name, value, size, flags); in SYSCALL_DEFINE5()
510 return error; in SYSCALL_DEFINE5()
520 ssize_t error; in getxattr() local
524 error = strncpy_from_user(kname, name, sizeof(kname)); in getxattr()
525 if (error == 0 || error == sizeof(kname)) in getxattr()
526 error = -ERANGE; in getxattr()
527 if (error < 0) in getxattr()
528 return error; in getxattr()
538 error = vfs_getxattr(d, kname, kvalue, size); in getxattr()
539 if (error > 0) { in getxattr()
542 posix_acl_fix_xattr_to_user(kvalue, error); in getxattr()
543 if (size && copy_to_user(value, kvalue, error)) in getxattr()
544 error = -EFAULT; in getxattr()
545 } else if (error == -ERANGE && size >= XATTR_SIZE_MAX) { in getxattr()
548 error = -E2BIG; in getxattr()
553 return error; in getxattr()
561 ssize_t error; in path_getxattr() local
563 error = user_path_at(AT_FDCWD, pathname, lookup_flags, &path); in path_getxattr()
564 if (error) in path_getxattr()
565 return error; in path_getxattr()
566 error = getxattr(path.dentry, name, value, size); in path_getxattr()
568 if (retry_estale(error, lookup_flags)) { in path_getxattr()
572 return error; in path_getxattr()
591 ssize_t error = -EBADF; in SYSCALL_DEFINE4() local
594 return error; in SYSCALL_DEFINE4()
596 error = getxattr(f.file->f_path.dentry, name, value, size); in SYSCALL_DEFINE4()
598 return error; in SYSCALL_DEFINE4()
607 ssize_t error; in listxattr() local
618 error = vfs_listxattr(d, klist, size); in listxattr()
619 if (error > 0) { in listxattr()
620 if (size && copy_to_user(list, klist, error)) in listxattr()
621 error = -EFAULT; in listxattr()
622 } else if (error == -ERANGE && size >= XATTR_LIST_MAX) { in listxattr()
625 error = -E2BIG; in listxattr()
630 return error; in listxattr()
637 ssize_t error; in path_listxattr() local
639 error = user_path_at(AT_FDCWD, pathname, lookup_flags, &path); in path_listxattr()
640 if (error) in path_listxattr()
641 return error; in path_listxattr()
642 error = listxattr(path.dentry, list, size); in path_listxattr()
644 if (retry_estale(error, lookup_flags)) { in path_listxattr()
648 return error; in path_listxattr()
666 ssize_t error = -EBADF; in SYSCALL_DEFINE3() local
669 return error; in SYSCALL_DEFINE3()
671 error = listxattr(f.file->f_path.dentry, list, size); in SYSCALL_DEFINE3()
673 return error; in SYSCALL_DEFINE3()
682 int error; in removexattr() local
685 error = strncpy_from_user(kname, name, sizeof(kname)); in removexattr()
686 if (error == 0 || error == sizeof(kname)) in removexattr()
687 error = -ERANGE; in removexattr()
688 if (error < 0) in removexattr()
689 return error; in removexattr()
698 int error; in path_removexattr() local
700 error = user_path_at(AT_FDCWD, pathname, lookup_flags, &path); in path_removexattr()
701 if (error) in path_removexattr()
702 return error; in path_removexattr()
703 error = mnt_want_write(path.mnt); in path_removexattr()
704 if (!error) { in path_removexattr()
705 error = removexattr(path.dentry, name); in path_removexattr()
709 if (retry_estale(error, lookup_flags)) { in path_removexattr()
713 return error; in path_removexattr()
731 int error = -EBADF; in SYSCALL_DEFINE2() local
734 return error; in SYSCALL_DEFINE2()
736 error = mnt_want_write_file(f.file); in SYSCALL_DEFINE2()
737 if (!error) { in SYSCALL_DEFINE2()
738 error = removexattr(f.file->f_path.dentry, name); in SYSCALL_DEFINE2()
742 return error; in SYSCALL_DEFINE2()