smb: client: change allocation requirements in DUP_CTX_STR macro
Subsystems (2)
PATCH 1/1 smb: client: change allocation requirements in DUP_CTX_STR macro
From: Fredric Cover <[email protected]>
Currently, the macro DUP_CTX_STR allocates new_ctx->field using GFP_ATOMIC. DUP_CTX_STR is only used in smb3_fs_context_dup(), which is never called in an atomic context. Using GFP_ATOMIC puts unnecessary pressure on emergency memory pools.
Change GFP_ATOMIC to GFP_KERNEL.
--- fs/smb/client/fs_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/smb/client/fs_context.c +1 -1
@@ -420,7 +420,7 @@ static int parse_symlink_flavor(struct fs_context *fc, char *value,#define DUP_CTX_STR (field) \ do { \ if (ctx->field) { \ - new_ctx->field = kstrdup(ctx->field, GFP_ATOMIC); \ + new_ctx->field = kstrdup(ctx->field, GFP_KERNEL); \ if (new_ctx->field == NULL) { \ smb3_cleanup_fs_context_contents(new_ctx); \ return -ENOMEM; \
Signature · 1 line
2.53.0
Hi Steve,
Following up on this patch. This logic should remain sound and still merge properly.
Let me know if you need any modifications.
Thanks,
Fredric Cover
Quoted 31 lines · Fredric Cover
From: Fredric Cover <[email protected]>
Currently, the macro
DUP_CTX_STRallocatesnew_ctx->fieldusingGFP_ATOMIC.DUP_CTX_STRis only used insmb3_fs_context_dup(), which is never called in an atomic context. UsingGFP_ATOMICputs unnecessary pressure on emergency memory pools.Change
GFP_ATOMICtoGFP_KERNEL.Signed-off-by Fredric Cover <[email protected]>--- fs/smb/client/fs_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/smb/client/fs_context.c +1
-2@@ -420,7 +420,7 @@ static int parse_symlink_flavor(struct fs_context *fc, char *value,#define DUP_CTX_STR (field) \ do { \ if (ctx->field) { \ - new_ctx->field = kstrdup(ctx->field, GFP_ATOMIC); \ + new_ctx->field = kstrdup(ctx->field, GFP_KERNEL); \ if (new_ctx->field == NULL) { \ smb3_cleanup_fs_context_contents(new_ctx); \ return -ENOMEM; \ --2.53.0
merged into cifs-2.6.git for-next pending additional testing and review
Quoted 44 lines · Fredric Cover
Hi Steve,
Following up on this patch. This logic should remain sound and still merge properly.
Let me know if you need any modifications.Thanks,
Fredric CoverQuoted 31 lines · Fredric Cover
From: Fredric Cover <[email protected]>
Currently, the macro
DUP_CTX_STRallocatesnew_ctx->fieldusingGFP_ATOMIC.DUP_CTX_STRis only used insmb3_fs_context_dup(), which is never called in an atomic context. UsingGFP_ATOMICputs unnecessary pressure on emergency memory pools.Change
GFP_ATOMICtoGFP_KERNEL.Signed-off-by Fredric Cover <[email protected]>--- fs/smb/client/fs_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/smb/client/fs_context.c +1
-2@@ -420,7 +420,7 @@ static int parse_symlink_flavor(struct fs_context *fc, char *value,#define DUP_CTX_STR (field) \ do { \ if (ctx->field) { \ - new_ctx->field = kstrdup(ctx->field, GFP_ATOMIC); \ + new_ctx->field = kstrdup(ctx->field, GFP_KERNEL); \ if (new_ctx->field == NULL) { \ smb3_cleanup_fs_context_contents(new_ctx); \ return -ENOMEM; \ --2.53.0
Signature · 3 lines
Thanks, Steve