From dc660009af7da7a1179def9597dc1ad8910243b3 Mon Sep 17 00:00:00 2001 From: YankunLi Date: Mon, 10 Jul 2017 16:39:58 +0800 Subject: [PATCH] BlueStore:Failure retry for opening file Failure retry to open file Signed-off-by: Yankun Li --- src/os/bluestore/BlueStore.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 7c9933c0213ff..f69a39d6a9f7a 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -3926,7 +3926,7 @@ int BlueStore::get_block_device_fsid(CephContext* cct, const string& path, int BlueStore::_open_path() { assert(path_fd < 0); - path_fd = ::open(path.c_str(), O_DIRECTORY); + path_fd = TEMP_FAILURE_RETRY(::open(path.c_str(), O_DIRECTORY)); if (path_fd < 0) { int r = -errno; derr << __func__ << " unable to open " << path << ": " << cpp_strerror(r) @@ -3954,7 +3954,7 @@ int BlueStore::_write_bdev_label(string path, bluestore_bdev_label_t label) z.zero(); bl.append(std::move(z)); - int fd = ::open(path.c_str(), O_WRONLY); + int fd = TEMP_FAILURE_RETRY(::open(path.c_str(), O_WRONLY)); if (fd < 0) { fd = -errno; derr << __func__ << " failed to open " << path << ": " << cpp_strerror(fd) @@ -3974,7 +3974,7 @@ int BlueStore::_read_bdev_label(CephContext* cct, string path, bluestore_bdev_label_t *label) { dout(10) << __func__ << dendl; - int fd = ::open(path.c_str(), O_RDONLY); + int fd = TEMP_FAILURE_RETRY(::open(path.c_str(), O_RDONLY)); if (fd < 0) { fd = -errno; derr << __func__ << " failed to open " << path << ": " << cpp_strerror(fd) -- 2.39.5