You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[iov_iter] new primitives - copy_from_iter_full() and friends
copy_from_iter_full(), copy_from_iter_full_nocache() and csum_and_copy_from_iter_full() - counterparts of copy_from_iter() et.al., advancing iterator only in case of successful full copy and returning whether it had been successful or not. Convert some obvious users. *NOTE* - do not blindly assume that something is a good candidate for those unless you are sure that not advancing iov_iter in failure case is the right thing in this case. Anything that does short read/short write kind of stuff (or is in a loop, etc.) is unlikely to be a good one. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -1074,7 +1074,7 @@ long keyctl_instantiate_key_common(key_serial_t id,
|
||||
}
|
||||
|
||||
ret = -EFAULT;
|
||||
if (copy_from_iter(payload, plen, from) != plen)
|
||||
if (!copy_from_iter_full(payload, plen, from))
|
||||
goto error2;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user