The following failure has been observed in CI (see [1], [2]):
storage-chown-by-maps: chown("/some/path"): interrupted system call
While chown and chmod should be auto-restartable by the kernel (provided
all the signal handlers are installed with SA_RESTART flag), it looks
like it is not always the case, or there might be some exclusions,
so this should be handled.
Surely, the possibility of getting EINTR is amplified since Go 1.14
introduced async preemptible goroutimes (see [3]), the feature that
is implemented via frequently sending signal 22 to all threads.
Add and use wrappers for Chmod and Lchown that retry on EINTR.
[1] https://github.com/containers/podman/issues/8152
[2] https://github.com/cri-o/cri-o/pull/4310#issuecomment-718361022
[3] https://golang.org/doc/go1.14#runtime
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>