Skip to content

Commit 5a60e87

Browse files
committed
rbd: use GFP_NOIO in rbd_obj_request_create()
rbd_obj_request_create() is called on the main I/O path, so we need to use GFP_NOIO to make sure allocation doesn't blow back on us. Not all callers need this, but I'm still hardcoding the flag inside rather than making it a parameter because a) this is going to stable, and b) those callers shouldn't really use rbd_obj_request_create() and will be fixed in the future. More memory allocation fixes will follow. Cc: [email protected] # 3.10+ Signed-off-by: Ilya Dryomov <[email protected]> Reviewed-by: Alex Elder <[email protected]>
1 parent 82cd003 commit 5a60e87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/block/rbd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2022,11 +2022,11 @@ static struct rbd_obj_request *rbd_obj_request_create(const char *object_name,
20222022
rbd_assert(obj_request_type_valid(type));
20232023

20242024
size = strlen(object_name) + 1;
2025-
name = kmalloc(size, GFP_KERNEL);
2025+
name = kmalloc(size, GFP_NOIO);
20262026
if (!name)
20272027
return NULL;
20282028

2029-
obj_request = kmem_cache_zalloc(rbd_obj_request_cache, GFP_KERNEL);
2029+
obj_request = kmem_cache_zalloc(rbd_obj_request_cache, GFP_NOIO);
20302030
if (!obj_request) {
20312031
kfree(name);
20322032
return NULL;

0 commit comments

Comments
 (0)