summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2013-04-10 14:55:13 -0700
committerSamuel Just <sam.just@inktank.com>2013-04-19 11:00:20 -0700
commit016e975ab969a9e656cbce7ebd658efd58fcfd50 (patch)
treeaaa4e75303498295841b193cacc453d8ada113fc
parent07a80ee35e710d8bdafb35d12c589ced2a46d299 (diff)
downloadceph-016e975ab969a9e656cbce7ebd658efd58fcfd50.tar.gz
FileStore::_do_copy_range: read(2) might return EINTR
Signed-off-by: Samuel Just <sam.just@inktank.com>
-rw-r--r--src/os/FileStore.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc
index 52e14a286c0..16ae21a700c 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.