xfs: replace strncpy with memcpy in xattr listing
PATCH 1/1 xfs: replace strncpy with memcpy in xattr listing
Use memcpy() in place of strncpy() in __xfs_xattr_put_listent(). The length is known and a null byte is added manually.
No functional change intended.
--- fs/xfs/xfs_xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_xattr.c +1 -1
@@ -243,7 +243,7 @@ __xfs_xattr_put_listent( offset = context->buffer + context->count;memcpy (offset, prefix, prefix_len); offset += prefix_len; -strncpy (offset, (char *)name, namelen);/* real name */ +memcpy (offset, (char *)name, namelen);/* real name */ offset += namelen; *offset ='\0' ;
Signature · 1 line
2.49.0
Carlos Maiolino
maintainerQuoted 15 lines · Pranav Tyagi
Use
memcpy()in place ofstrncpy()in__xfs_xattr_put_listent(). The length is known and a null byte is added manually.No functional change intended.
Signed-off-by Pranav Tyagi <[email protected]>--- fs/xfs/xfs_xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/xfs/xfs_xattr.c +0
-0
fs/xfs/xfs_xattr.c __xfs_xattr_put_listent( · line 248
Quoted 7 lines
fs/xfs/xfs_xattr.c +1
-1@@ -243,7 +243,7 @@ __xfs_xattr_put_listent( offset = context->buffer + context->count;memcpy (offset, prefix, prefix_len); offset += prefix_len; -strncpy (offset, (char *)name, namelen);/* real name */ +memcpy (offset, (char *)name, namelen);/* real name */ offset += namelen; *offset ='\0' ;
What difference does it make?
Quoted 4 lines
fs/xfs/xfs_xattr.c +0
-1--2.49.0
Quoted 12 lines · Carlos Maiolino
Quoted 10 lines · Pranav Tyagi
Use
memcpy()in place ofstrncpy()in__xfs_xattr_put_listent(). The length is known and a null byte is added manually.No functional change intended.
Signed-off-by Pranav Tyagi <[email protected]>--- fs/xfs/xfs_xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines
fs/xfs/xfs_xattr.c __xfs_xattr_put_listent( · line 248
Quoted 12 lines
fs/xfs/xfs_xattr.c +1
-1@@ -243,7 +243,7 @@ __xfs_xattr_put_listent( offset = context->buffer + context->count;memcpy (offset, prefix, prefix_len); offset += prefix_len; -strncpy (offset, (char *)name, namelen);/* real name */ +memcpy (offset, (char *)name, namelen);/* real name */ offset += namelen; *offset ='\0' ;What difference does it make?
I intended this to be a cleanup patch as strncpy() is deprecated and its use discouraged.
Regards
Pranav Tyagi
Quoted 6 lines
Quoted 6 lines
fs/xfs/xfs_xattr.c +0
-1--2.49.0
Quoted 28 lines · Pranav Tyagi
Quoted 12 lines · Carlos Maiolino
Quoted 10 lines · Pranav Tyagi
Use
memcpy()in place ofstrncpy()in__xfs_xattr_put_listent(). The length is known and a null byte is added manually.No functional change intended.
Signed-off-by Pranav Tyagi <[email protected]>--- fs/xfs/xfs_xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 14 lines
fs/xfs/xfs_xattr.c __xfs_xattr_put_listent( · line 248
Quoted 12 lines
fs/xfs/xfs_xattr.c +1
-1@@ -243,7 +243,7 @@ __xfs_xattr_put_listent( offset = context->buffer + context->count;memcpy (offset, prefix, prefix_len); offset += prefix_len; -strncpy (offset, (char *)name, namelen);/* real name */ +memcpy (offset, (char *)name, namelen);/* real name */ offset += namelen; *offset ='\0' ;What difference does it make?
Quoted 2 lines
I intended this to be a cleanup patch as
strncpy()is deprecated and its use discouraged.
Fair enough. This is the kind of information that's worth to add to the patch description on your future patches.
No need to re-send this again.
Quoted 9 lines
Regards
Pranav TyagiQuoted 6 lines
Quoted 6 lines
fs/xfs/xfs_xattr.c +0
-1--2.49.0
Quoted 33 lines · Carlos Maiolino
Quoted 28 lines · Pranav Tyagi
Quoted 12 lines · Carlos Maiolino
Quoted 10 lines · Pranav Tyagi
Use
memcpy()in place ofstrncpy()in__xfs_xattr_put_listent(). The length is known and a null byte is added manually.No functional change intended.
Signed-off-by Pranav Tyagi <[email protected]>--- fs/xfs/xfs_xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 14 lines
fs/xfs/xfs_xattr.c __xfs_xattr_put_listent( · line 248
Quoted 12 lines
fs/xfs/xfs_xattr.c +1
-1@@ -243,7 +243,7 @@ __xfs_xattr_put_listent( offset = context->buffer + context->count;memcpy (offset, prefix, prefix_len); offset += prefix_len; -strncpy (offset, (char *)name, namelen);/* real name */ +memcpy (offset, (char *)name, namelen);/* real name */ offset += namelen; *offset ='\0' ;What difference does it make?
Quoted 2 lines
I intended this to be a cleanup patch as
strncpy()is deprecated and its use discouraged.
Quoted 6 lines
Fair enough. This is the kind of information that's worth to add to the patch description on your future patches.
No need to re-send this again.
Reviewed-by Carlos Maiolino <[email protected]>
Thanks Darrick and Carlos for the Reviewed-by tag.
I also wanted to ask if this patch has been queued for merging.
Regards
Pranav Tyagi
Quoted 10 lines
Quoted 10 lines
Regards
Pranav TyagiQuoted 6 lines
Quoted 6 lines
fs/xfs/xfs_xattr.c +0
-1--2.49.0
Carlos Maiolino
maintainerQuoted 37 lines · Pranav Tyagi
Quoted 36 lines · Carlos Maiolino
Quoted 28 lines · Pranav Tyagi
Quoted 12 lines · Carlos Maiolino
Quoted 10 lines · Pranav Tyagi
Use
memcpy()in place ofstrncpy()in__xfs_xattr_put_listent(). The length is known and a null byte is added manually.No functional change intended.
Signed-off-by Pranav Tyagi <[email protected]>--- fs/xfs/xfs_xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 14 lines
fs/xfs/xfs_xattr.c __xfs_xattr_put_listent( · line 248
Quoted 12 lines
fs/xfs/xfs_xattr.c +1
-1@@ -243,7 +243,7 @@ __xfs_xattr_put_listent( offset = context->buffer + context->count;memcpy (offset, prefix, prefix_len); offset += prefix_len; -strncpy (offset, (char *)name, namelen);/* real name */ +memcpy (offset, (char *)name, namelen);/* real name */ offset += namelen; *offset ='\0' ;What difference does it make?
Quoted 2 lines
I intended this to be a cleanup patch as
strncpy()is deprecated and its use discouraged.Fair enough. This is the kind of information that's worth to add to the patch description on your future patches.
Quoted 7 lines
Quoted 3 lines
No need to re-send this again.
Reviewed-by Carlos Maiolino <[email protected]>Thanks Darrick and Carlos for the Reviewed-by tag.
I also wanted to ask if this patch has been queued for merging.
xfs teams sends an ANNOUNCE email every merge done to the for-next branch, you can check if your patches are mentioned there, if not they are not queued up yet.
Also, you'll likely receive a message saying your patch has been pushed into for-next.
Note though that just because your patch has been added to for-next, doesn't automatically mean it will be merged. Several tests still happens on patches pushed to for-next branch (which are merged into linux-next) and linux-next 'after' your patch has been merged into.
So your patch(es) being merged are conditional to that.
Carlos
Quoted 14 lines
Regards
Pranav TyagiQuoted 10 lines
Quoted 10 lines
Regards
Pranav TyagiQuoted 6 lines
Quoted 6 lines
fs/xfs/xfs_xattr.c +0
-1--2.49.0
Quoted 54 lines · Carlos Maiolino
Quoted 37 lines · Pranav Tyagi
Quoted 36 lines · Carlos Maiolino
Quoted 28 lines · Pranav Tyagi
Quoted 12 lines · Carlos Maiolino
Quoted 10 lines · Pranav Tyagi
Use
memcpy()in place ofstrncpy()in__xfs_xattr_put_listent(). The length is known and a null byte is added manually.No functional change intended.
Signed-off-by Pranav Tyagi <[email protected]>--- fs/xfs/xfs_xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 14 lines
fs/xfs/xfs_xattr.c __xfs_xattr_put_listent( · line 248
Quoted 12 lines
fs/xfs/xfs_xattr.c +1
-1@@ -243,7 +243,7 @@ __xfs_xattr_put_listent( offset = context->buffer + context->count;memcpy (offset, prefix, prefix_len); offset += prefix_len; -strncpy (offset, (char *)name, namelen);/* real name */ +memcpy (offset, (char *)name, namelen);/* real name */ offset += namelen; *offset ='\0' ;What difference does it make?
Quoted 2 lines
I intended this to be a cleanup patch as
strncpy()is deprecated and its use discouraged.Fair enough. This is the kind of information that's worth to add to the patch description on your future patches.
Quoted 7 lines
Quoted 3 lines
No need to re-send this again.
Reviewed-by Carlos Maiolino <[email protected]>Thanks Darrick and Carlos for the Reviewed-by tag.
I also wanted to ask if this patch has been queued for merging.
xfs teams sends an ANNOUNCE email every merge done to the for-next branch, you can check if your patches are mentioned there, if not they are not queued up yet.
Also, you'll likely receive a message saying your patch has been pushed into for-next.
Quoted 9 lines
Note though that just because your patch has been added to for-next, doesn't automatically mean it will be merged. Several tests still happens on patches pushed to for-next branch (which are merged into linux-next) and linux-next 'after' your patch has been merged into.
So your patch(es) being merged are conditional to that.
Carlos
Hi,
Thanks for the clarification. I'll keep an eye on the announce emails and wait to see if my patch gets mentioned or pushed to the for-next branch.
Appreciate the insight into the review and testing process. That helps a lot.
Regards
Pranav Tyagi
Quoted 14 lines
Quoted 14 lines
Regards
Pranav TyagiQuoted 10 lines
Quoted 10 lines
Regards
Pranav TyagiQuoted 6 lines
Quoted 6 lines
fs/xfs/xfs_xattr.c +0
-1--2.49.0
Quoted 6 lines · Pranav Tyagi
Use
memcpy()in place ofstrncpy()in__xfs_xattr_put_listent(). The length is known and a null byte is added manually.No functional change intended.
Signed-off-by Pranav Tyagi <[email protected]>
'tis better than the three previous attempts at this (compliments on working out that *name isn't a null terminated string!), so
--D
Quoted 21 lines
--- fs/xfs/xfs_xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/xfs/xfs_xattr.c +1
-1@@ -243,7 +243,7 @@ __xfs_xattr_put_listent( offset = context->buffer + context->count;memcpy (offset, prefix, prefix_len); offset += prefix_len; -strncpy (offset, (char *)name, namelen);/* real name */ +memcpy (offset, (char *)name, namelen);/* real name */ offset += namelen; *offset ='\0' ;Signature · 1 line
2.49.0
Quoted 6 lines · Pranav Tyagi
Use
memcpy()in place ofstrncpy()in__xfs_xattr_put_listent(). The length is known and a null byte is added manually.No functional change intended.
Applied to for-next, thanks!
[1/1] xfs: replace strncpy with memcpy in xattr listing
commit: f2eb2796b95118b877b63d9fcd3459e70494a498
Best regards,
Signature · 1 line
Carlos Maiolino <[email protected]>