Check for ENOSPC on shmget() failure
authorJens Axboe <axboe@kernel.dk>
Fri, 21 Sep 2012 13:05:45 +0000 (15:05 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 21 Sep 2012 13:05:45 +0000 (15:05 +0200)
We scale down the number of jobs based on EINVAL and ENOMEM,
but ENOSPC is a valid 'segment too big' error as well.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
init.c

diff --git a/init.c b/init.c
index da1f472db35111b806539fe38359aa19103bd2ed..b3215f52fca3ebb2306c5e02e8437aac0a6d57fa 100644 (file)
--- a/init.c
+++ b/init.c
@@ -254,7 +254,7 @@ static int setup_thread_area(void)
                shm_id = shmget(0, size, IPC_CREAT | 0600);
                if (shm_id != -1)
                        break;
-               if (errno != EINVAL && errno != ENOMEM) {
+               if (errno != EINVAL && errno != ENOMEM && errno != ENOSPC) {
                        perror("shmget");
                        break;
                }