You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/03/26 15:37:29 UTC
[GitHub] [incubator-nuttx] Donny9 opened a new pull request #5856: rpmsgfs/rename: fix bug about pathname align with 8bytes
Donny9 opened a new pull request #5856:
URL: https://github.com/apache/incubator-nuttx/pull/5856
## Summary
rpmsgfs/rename: fix bug about pathname align with 8bytes
Signed-off-by: Jiuzhu Dong <do...@xiaomi.com>
## Impact
Fix bug about rmpsg rename
## Testing
Daily test
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #5856: rpmsgfs/rename: fix bug about pathname align with 8bytes
Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #5856:
URL: https://github.com/apache/incubator-nuttx/pull/5856#discussion_r835787782
##########
File path: fs/rpmsgfs/rpmsgfs_client.c
##########
@@ -727,11 +727,13 @@ int rpmsgfs_client_rename(FAR void *handle, FAR const char *oldpath,
size_t len;
size_t oldlen;
size_t newlen;
+ size_t alignlen;
uint32_t space;
- oldlen = strlen(oldpath) + 1;
- newlen = strlen(newpath) + 1;
- len = sizeof(*msg) + oldlen + newlen;
+ oldlen = strlen(oldpath) + 1;
+ alignlen = (oldlen + 0x7) & ~0x7;
Review comment:
How about creating a macro like https://github.com/apache/incubator-nuttx/blob/f623ac0f13ab893ef0c209325d2ac1ff85f405ee/arch/risc-v/src/esp32c3/esp32c3_dma.c#L62?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] Donny9 commented on a change in pull request #5856: rpmsgfs/rename: fix bug about pathname align with 8bytes
Posted by GitBox <gi...@apache.org>.
Donny9 commented on a change in pull request #5856:
URL: https://github.com/apache/incubator-nuttx/pull/5856#discussion_r835832612
##########
File path: fs/rpmsgfs/rpmsgfs_client.c
##########
@@ -727,11 +727,13 @@ int rpmsgfs_client_rename(FAR void *handle, FAR const char *oldpath,
size_t len;
size_t oldlen;
size_t newlen;
+ size_t alignlen;
uint32_t space;
- oldlen = strlen(oldpath) + 1;
- newlen = strlen(newpath) + 1;
- len = sizeof(*msg) + oldlen + newlen;
+ oldlen = strlen(oldpath) + 1;
+ alignlen = (oldlen + 0x7) & ~0x7;
Review comment:
Let's keep it the same as rpmsgfs_server.c:rpmsgfs_rename_handler?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] pkarashchenko merged pull request #5856: rpmsgfs/rename: fix bug about pathname align with 8bytes
Posted by GitBox <gi...@apache.org>.
pkarashchenko merged pull request #5856:
URL: https://github.com/apache/incubator-nuttx/pull/5856
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5856: rpmsgfs/rename: fix bug about pathname align with 8bytes
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5856:
URL: https://github.com/apache/incubator-nuttx/pull/5856#discussion_r835788030
##########
File path: fs/rpmsgfs/rpmsgfs_client.c
##########
@@ -727,11 +727,13 @@ int rpmsgfs_client_rename(FAR void *handle, FAR const char *oldpath,
size_t len;
size_t oldlen;
size_t newlen;
+ size_t alignlen;
uint32_t space;
- oldlen = strlen(oldpath) + 1;
- newlen = strlen(newpath) + 1;
- len = sizeof(*msg) + oldlen + newlen;
+ oldlen = strlen(oldpath) + 1;
+ alignlen = (oldlen + 0x7) & ~0x7;
Review comment:
`ALIGN_UP` is not a standard macro as well as `ARRAY_SIZE`, so usually it is defined in each place individually. If the align up logic is used more than once in the file maybe it is reasonable to add a macro
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5856: rpmsgfs/rename: fix bug about pathname align with 8bytes
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5856:
URL: https://github.com/apache/incubator-nuttx/pull/5856#discussion_r835788089
##########
File path: fs/rpmsgfs/rpmsgfs_client.c
##########
@@ -727,11 +727,13 @@ int rpmsgfs_client_rename(FAR void *handle, FAR const char *oldpath,
size_t len;
size_t oldlen;
size_t newlen;
+ size_t alignlen;
uint32_t space;
- oldlen = strlen(oldpath) + 1;
- newlen = strlen(newpath) + 1;
- len = sizeof(*msg) + oldlen + newlen;
+ oldlen = strlen(oldpath) + 1;
+ alignlen = (oldlen + 0x7) & ~0x7;
Review comment:
I will let author to reply on this before merging
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] gustavonihei commented on a change in pull request #5856: rpmsgfs/rename: fix bug about pathname align with 8bytes
Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #5856:
URL: https://github.com/apache/incubator-nuttx/pull/5856#discussion_r835788229
##########
File path: fs/rpmsgfs/rpmsgfs_client.c
##########
@@ -727,11 +727,13 @@ int rpmsgfs_client_rename(FAR void *handle, FAR const char *oldpath,
size_t len;
size_t oldlen;
size_t newlen;
+ size_t alignlen;
uint32_t space;
- oldlen = strlen(oldpath) + 1;
- newlen = strlen(newpath) + 1;
- len = sizeof(*msg) + oldlen + newlen;
+ oldlen = strlen(oldpath) + 1;
+ alignlen = (oldlen + 0x7) & ~0x7;
Review comment:
Just a suggestion for improving the readability.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org