]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
FileJournal::_open: return the correct error code 7638/head
authorAlexey Sheplyakov <asheplyakov@mirantis.com>
Fri, 12 Feb 2016 17:56:02 +0000 (20:56 +0300)
committerAlexey Sheplyakov <asheplyakov@mirantis.com>
Mon, 15 Feb 2016 10:58:03 +0000 (13:58 +0300)
.. and print a more helpful error message. Unlike most of IO routines
(open, creat, write*, read, close) io_setup does NOT set the errno,
instead it returns the negated error code. Also -EAGAIN indicates
the limit of available events has been exceeded.

Signed-off-by: Alexey Sheplyakov <asheplyakov@mirantis.com>
src/os/filestore/FileJournal.cc

index 7763c6f95f4dbc9a6ce2bfe396c1180e3ad9fe37..ed93598a5e63fe630e1063d880fcadb4d704b6df 100644 (file)
@@ -103,9 +103,16 @@ int FileJournal::_open(bool forwrite, bool create)
     aio_ctx = 0;
     ret = io_setup(128, &aio_ctx);
     if (ret < 0) {
-      ret = errno;
-      derr << "FileJournal::_open: unable to setup io_context " << cpp_strerror(ret) << dendl;
-      ret = -ret;
+      switch (ret) {
+       // Contrary to naive expectations -EAGIAN means ...
+       case -EAGAIN:
+         derr << "FileJournal::_open: user's limit of aio events exceeded. "
+              << "Try increasing /proc/sys/fs/aio-max-nr" << dendl;
+         break;
+       default:
+         derr << "FileJournal::_open: unable to setup io_context " << cpp_strerror(-ret) << dendl;
+         break;
+      }
       goto out_fd;
     }
   }