re-encrypt doesn't handle EINTR
Issue 226 by ludwig.nus...@suse.de on 2014-09-15 10:06:04:
Forwarding a minor issue in reencrytion support reported by Stephan
Mueller:
---->8----
copy_data_forward contains:
s1 = read\(fd\_old, buf, block\_size\);
if \(s1 < 0 || \(\(size\_t\)s1 != block\_size &&
\(rc\->device\_offset \+ s1\) != rc\->device\_size\)\) {
log\_dbg\("Read error, expecting %d, got %d.",
\(int\)block\_size, \(int\)s1\);
return \-EIO;
}
IMHO the unconditional failure is not always correct, because the code
does not check for EINTR and ERESTARTSYS. When you get an
EINTR/ERESTARTSYS, the code needs to re-setup the read.
The same applies to copy_data_backward.
---->8----