Lines Matching refs:error
173 int error = -EAGAIN; in __vfs_setxattr_noperm() local
180 error = __vfs_setxattr(dentry, inode, name, value, size, flags); in __vfs_setxattr_noperm()
181 if (!error) { in __vfs_setxattr_noperm()
190 if (error == -EAGAIN) { in __vfs_setxattr_noperm()
191 error = -EOPNOTSUPP; in __vfs_setxattr_noperm()
196 error = security_inode_setsecurity(inode, suffix, value, in __vfs_setxattr_noperm()
198 if (!error) in __vfs_setxattr_noperm()
203 return error; in __vfs_setxattr_noperm()
212 int error; in vfs_setxattr() local
214 error = xattr_permission(inode, name, MAY_WRITE); in vfs_setxattr()
215 if (error) in vfs_setxattr()
216 return error; in vfs_setxattr()
219 error = security_inode_setxattr(dentry, name, value, size, flags); in vfs_setxattr()
220 if (error) in vfs_setxattr()
223 error = __vfs_setxattr_noperm(dentry, name, value, size, flags); in vfs_setxattr()
227 return error; in vfs_setxattr()
272 int error; in vfs_getxattr_alloc() local
274 error = xattr_permission(inode, name, MAY_READ); in vfs_getxattr_alloc()
275 if (error) in vfs_getxattr_alloc()
276 return error; in vfs_getxattr_alloc()
283 error = handler->get(handler, dentry, inode, name, NULL, 0); in vfs_getxattr_alloc()
284 if (error < 0) in vfs_getxattr_alloc()
285 return error; in vfs_getxattr_alloc()
287 if (!value || (error > xattr_size)) { in vfs_getxattr_alloc()
288 value = krealloc(*xattr_value, error + 1, flags); in vfs_getxattr_alloc()
291 memset(value, 0, error + 1); in vfs_getxattr_alloc()
294 error = handler->get(handler, dentry, inode, name, value, error); in vfs_getxattr_alloc()
296 return error; in vfs_getxattr_alloc()
318 int error; in vfs_getxattr() local
320 error = xattr_permission(inode, name, MAY_READ); in vfs_getxattr()
321 if (error) in vfs_getxattr()
322 return error; in vfs_getxattr()
324 error = security_inode_getxattr(dentry, name); in vfs_getxattr()
325 if (error) in vfs_getxattr()
326 return error; in vfs_getxattr()
349 ssize_t error; in vfs_listxattr() local
351 error = security_inode_listxattr(dentry); in vfs_listxattr()
352 if (error) in vfs_listxattr()
353 return error; in vfs_listxattr()
355 error = inode->i_op->listxattr(dentry, list, size); in vfs_listxattr()
357 error = security_inode_listsecurity(inode, list, size); in vfs_listxattr()
358 if (size && error > size) in vfs_listxattr()
359 error = -ERANGE; in vfs_listxattr()
361 return error; in vfs_listxattr()
384 int error; in vfs_removexattr() local
386 error = xattr_permission(inode, name, MAY_WRITE); in vfs_removexattr()
387 if (error) in vfs_removexattr()
388 return error; in vfs_removexattr()
391 error = security_inode_removexattr(dentry, name); in vfs_removexattr()
392 if (error) in vfs_removexattr()
395 error = __vfs_removexattr(dentry, name); in vfs_removexattr()
397 if (!error) { in vfs_removexattr()
404 return error; in vfs_removexattr()
416 int error; in setxattr() local
423 error = strncpy_from_user(kname, name, sizeof(kname)); in setxattr()
424 if (error == 0 || error == sizeof(kname)) in setxattr()
425 error = -ERANGE; in setxattr()
426 if (error < 0) in setxattr()
427 return error; in setxattr()
436 error = -EFAULT; in setxattr()
443 error = cap_convert_nscap(d, &kvalue, size); in setxattr()
444 if (error < 0) in setxattr()
446 size = error; in setxattr()
450 error = vfs_setxattr(d, kname, kvalue, size, flags); in setxattr()
454 return error; in setxattr()
462 int error; in path_setxattr() local
464 error = user_path_at(AT_FDCWD, pathname, lookup_flags, &path); in path_setxattr()
465 if (error) in path_setxattr()
466 return error; in path_setxattr()
467 error = mnt_want_write(path.mnt); in path_setxattr()
468 if (!error) { in path_setxattr()
469 error = setxattr(path.dentry, name, value, size, flags); in path_setxattr()
473 if (retry_estale(error, lookup_flags)) { in path_setxattr()
477 return error; in path_setxattr()
498 int error = -EBADF; in SYSCALL_DEFINE5() local
501 return error; in SYSCALL_DEFINE5()
503 error = mnt_want_write_file(f.file); in SYSCALL_DEFINE5()
504 if (!error) { in SYSCALL_DEFINE5()
505 error = setxattr(f.file->f_path.dentry, name, value, size, flags); in SYSCALL_DEFINE5()
509 return error; in SYSCALL_DEFINE5()
519 ssize_t error; in getxattr() local
523 error = strncpy_from_user(kname, name, sizeof(kname)); in getxattr()
524 if (error == 0 || error == sizeof(kname)) in getxattr()
525 error = -ERANGE; in getxattr()
526 if (error < 0) in getxattr()
527 return error; in getxattr()
537 error = vfs_getxattr(d, kname, kvalue, size); in getxattr()
538 if (error > 0) { in getxattr()
541 posix_acl_fix_xattr_to_user(kvalue, error); in getxattr()
542 if (size && copy_to_user(value, kvalue, error)) in getxattr()
543 error = -EFAULT; in getxattr()
544 } else if (error == -ERANGE && size >= XATTR_SIZE_MAX) { in getxattr()
547 error = -E2BIG; in getxattr()
552 return error; in getxattr()
560 ssize_t error; in path_getxattr() local
562 error = user_path_at(AT_FDCWD, pathname, lookup_flags, &path); in path_getxattr()
563 if (error) in path_getxattr()
564 return error; in path_getxattr()
565 error = getxattr(path.dentry, name, value, size); in path_getxattr()
567 if (retry_estale(error, lookup_flags)) { in path_getxattr()
571 return error; in path_getxattr()
590 ssize_t error = -EBADF; in SYSCALL_DEFINE4() local
593 return error; in SYSCALL_DEFINE4()
595 error = getxattr(f.file->f_path.dentry, name, value, size); in SYSCALL_DEFINE4()
597 return error; in SYSCALL_DEFINE4()
606 ssize_t error; in listxattr() local
617 error = vfs_listxattr(d, klist, size); in listxattr()
618 if (error > 0) { in listxattr()
619 if (size && copy_to_user(list, klist, error)) in listxattr()
620 error = -EFAULT; in listxattr()
621 } else if (error == -ERANGE && size >= XATTR_LIST_MAX) { in listxattr()
624 error = -E2BIG; in listxattr()
629 return error; in listxattr()
636 ssize_t error; in path_listxattr() local
638 error = user_path_at(AT_FDCWD, pathname, lookup_flags, &path); in path_listxattr()
639 if (error) in path_listxattr()
640 return error; in path_listxattr()
641 error = listxattr(path.dentry, list, size); in path_listxattr()
643 if (retry_estale(error, lookup_flags)) { in path_listxattr()
647 return error; in path_listxattr()
665 ssize_t error = -EBADF; in SYSCALL_DEFINE3() local
668 return error; in SYSCALL_DEFINE3()
670 error = listxattr(f.file->f_path.dentry, list, size); in SYSCALL_DEFINE3()
672 return error; in SYSCALL_DEFINE3()
681 int error; in removexattr() local
684 error = strncpy_from_user(kname, name, sizeof(kname)); in removexattr()
685 if (error == 0 || error == sizeof(kname)) in removexattr()
686 error = -ERANGE; in removexattr()
687 if (error < 0) in removexattr()
688 return error; in removexattr()
697 int error; in path_removexattr() local
699 error = user_path_at(AT_FDCWD, pathname, lookup_flags, &path); in path_removexattr()
700 if (error) in path_removexattr()
701 return error; in path_removexattr()
702 error = mnt_want_write(path.mnt); in path_removexattr()
703 if (!error) { in path_removexattr()
704 error = removexattr(path.dentry, name); in path_removexattr()
708 if (retry_estale(error, lookup_flags)) { in path_removexattr()
712 return error; in path_removexattr()
730 int error = -EBADF; in SYSCALL_DEFINE2() local
733 return error; in SYSCALL_DEFINE2()
735 error = mnt_want_write_file(f.file); in SYSCALL_DEFINE2()
736 if (!error) { in SYSCALL_DEFINE2()
737 error = removexattr(f.file->f_path.dentry, name); in SYSCALL_DEFINE2()
741 return error; in SYSCALL_DEFINE2()