libceph: allocate ceph_osd with GFP_NOFAIL
authorIlya Dryomov <idryomov@gmail.com>
Thu, 28 Apr 2016 14:07:25 +0000 (16:07 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 25 May 2016 23:12:29 +0000 (01:12 +0200)
create_osd() is called way too deep in the stack to be able to error
out in a sane way; a failing create_osd() just messes everything up.
The current req_notarget list solution is broken - the list is never
traversed as it's not entirely clear when to do it, I guess.

If we were to start traversing it at regular intervals and retrying
each request, we wouldn't be far off from what __GFP_NOFAIL is doing,
so allocate OSD sessions with __GFP_NOFAIL, at least until we come up
with a better fix.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
net/ceph/osd_client.c

index 77f37b6..b6950c2 100644 (file)
@@ -1043,10 +1043,7 @@ static struct ceph_osd *create_osd(struct ceph_osd_client *osdc, int onum)
 
        WARN_ON(onum == CEPH_HOMELESS_OSD);
 
-       osd = kzalloc(sizeof(*osd), GFP_NOFS);
-       if (!osd)
-               return NULL;
-
+       osd = kzalloc(sizeof(*osd), GFP_NOIO | __GFP_NOFAIL);
        osd_init(osd);
        osd->o_osdc = osdc;
        osd->o_osd = onum;