From 016e975ab969a9e656cbce7ebd658efd58fcfd50 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Wed, 10 Apr 2013 14:55:13 -0700 Subject: [PATCH] FileStore::_do_copy_range: read(2) might return EINTR Signed-off-by: Samuel Just --- src/os/FileStore.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 52e14a286c0d..16ae21a700cd 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -3194,10 +3194,14 @@ int FileStore::_do_copy_range(int from, int to, uint64_t srcoff, uint64_t len, u r = ::read(from, buf, l); dout(25) << " read from " << pos << "~" << l << " got " << r << dendl; if (r < 0) { - r = -errno; - derr << "FileStore::_do_copy_range: read error at " << pos << "~" << len - << ", " << cpp_strerror(r) << dendl; - break; + if (errno == EINTR) { + continue; + } else { + r = -errno; + derr << "FileStore::_do_copy_range: read error at " << pos << "~" << len + << ", " << cpp_strerror(r) << dendl; + break; + } } if (r == 0) { // hrm, bad source range, wtf. -- 2.47.3