]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
BlueStore:Failure retry for opening file 16237/head
authorYankunLi <lioveni99@gmail.com>
Mon, 10 Jul 2017 08:39:58 +0000 (16:39 +0800)
committerYankunLi <lioveni99@gmail.com>
Mon, 10 Jul 2017 08:39:58 +0000 (16:39 +0800)
Failure retry to open file

Signed-off-by: Yankun Li <lioveni99@gmail.com>
src/os/bluestore/BlueStore.cc

index 7c9933c0213ff608022f257c138b95687dd91d84..f69a39d6a9f7acb4f3e0f381ea4a4c93f41403b7 100644 (file)
@@ -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)