dlm: replace one-element array with fixed size array
PATCH 1/1 dlm: replace one-element array with fixed size array
One-element arrays are deprecated. So, replace one-element array with fixed size array member in struct dlm_ls, and refactor the rest of the code, accordingly.
--- fs/dlm/dlm_internal.h | 2 +- fs/dlm/lockspace.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
fs/dlm/dlm_internal.h +1 -1
@@ -670,7 +670,7 @@ struct dlm_ls {void *ls_ops_arg;int ls_namelen; -char ls_name[1 ]; +char ls_name[DLM_LOCKSPACE_LEN +1 ]; };/*
fs/dlm/lockspace.c +1 -1
@@ -473,7 +473,7 @@ static int new_lockspace(const char *name, const char *cluster, error = -ENOMEM ; - ls =kzalloc (sizeof (struct dlm_ls ) + namelen,GFP_NOFS ); + ls =kzalloc (sizeof (struct dlm_ls ),GFP_NOFS );if (!ls) goto out;memcpy (ls->ls_name, name, namelen);
Signature · 1 line
2.37.3
Quoted 10 lines · Paulo Miguel Almeida
One-element arrays are deprecated. So, replace one-element array with fixed size array member in struct
dlm_ls, and refactor the rest of the code, accordingly.Link https://lore.kernel.org/lkml/Y0W5jkiXUkpNl4ap at mail.google.com/Signed-off-by Paulo Miguel Almeida <[email protected]>
I think this should be versioned as v3.
Quoted 23 lines
--- fs/dlm/dlm_internal.h | 2 +- fs/dlm/lockspace.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)fs/dlm/dlm_internal.h +1
-1@@ -670,7 +670,7 @@ struct dlm_ls {void *ls_ops_arg;int ls_namelen; -char ls_name[1 ]; +char ls_name[DLM_LOCKSPACE_LEN +1 ]; };/* fs/dlm/lockspace.c +0
-0
fs/dlm/lockspace.c static int new_lockspace(const char *name, const char *cluster, · line 476
Quoted 5 lines
fs/dlm/lockspace.c +1
-1@@ -473,7 +473,7 @@ static int new_lockspace(const char *name, const char *cluster, error = -ENOMEM ; - ls =kzalloc (sizeof (struct dlm_ls ) + namelen,GFP_NOFS ); + ls =kzalloc (sizeof (struct dlm_ls ),GFP_NOFS );
sizeof(*ls) is preferred here....^^^
--
Gustavo
Quoted 5 lines · Gustavo A. R. Silva
Quoted 4 lines · Paulo Miguel Almeida
One-element arrays are deprecated. So, replace one-element array with fixed size array member in struct
dlm_ls, and refactor the rest of the code, accordingly.
Quoted 9 lines
Quoted 6 lines
Link https://lore.kernel.org/lkml/Y0W5jkiXUkpNl4ap at mail.google.com/Signed-off-by Paulo Miguel Almeida <[email protected]>I think this should be versioned as v3.
I didn't add v3 here because the the patch got changed from 'replacing [1]-array with flex-array' to 'replacing [1]-array to fixed-size array'.
Let me know if you still want me to send it as v3 instead.
Paulo A.
Quoted 11 lines · Paulo Miguel Almeida
Quoted 10 lines · Gustavo A. R. Silva
Quoted 9 lines · Paulo Miguel Almeida
One-element arrays are deprecated. So, replace one-element array with fixed size array member in struct
dlm_ls, and refactor the rest of the code, accordingly.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Paulo Miguel Almeida <[email protected]>I think this should be versioned as v3.
I didn't add v3 here because the the patch got changed from 'replacing [1]-array with flex-array' to 'replacing [1]-array to fixed-size array'.
The issue remains the same, and there have been comments and feedback on previous patches. So, yep, v3 seems appropiate for this patch. :)
Quoted 2 lines
Let me know if you still want me to send it as v3 instead.
I think next one would be v4.
Also, when versioning patches it is also necessary to include a version change log.
Thanks
--
Gustavo
Quoted 9 lines · Gustavo A. R. Silva
Quoted 3 lines · Paulo Miguel Almeida
Quoted 1 line
I didn't add v3 here because the the patch got changed from 'replacing [1]-array with flex-array' to 'replacing [1]-array to fixed-size array'.
The issue remains the same, and there have been comments and feedback on previous patches. So, yep, v3 seems appropiate for this patch. :)
Quoted 1 line
Quoted 7 lines
Quoted 1 line
Let me know if you still want me to send it as v3 instead.
I think next one would be v4.
Also, when versioning patches it is also necessary to include a version change log.
Fair enough. Will send a v4
Paulo A.