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 2020/12/23 06:36:31 UTC
[GitHub] [incubator-nuttx] xiaoxiang781216 opened a new pull request #2591: fs: Remove the softlink check from unlink
xiaoxiang781216 opened a new pull request #2591:
URL: https://github.com/apache/incubator-nuttx/pull/2591
## Summary
since the softlink is a special node too(include/nuttx/fs.h):
```
#define FSNODEFLAG_TYPE_MASK 0x0000000f /* Isolates type field */
#define FSNODEFLAG_TYPE_DRIVER 0x00000000 /* Character driver */
#define FSNODEFLAG_TYPE_BLOCK 0x00000001 /* Block driver */
#define FSNODEFLAG_TYPE_MOUNTPT 0x00000002 /* Mount point */
#define FSNODEFLAG_TYPE_SPECIAL 0x00000008 /* Special OS type */
#define FSNODEFLAG_TYPE_NAMEDSEM 0x00000008 /* Named semaphore */
#define FSNODEFLAG_TYPE_MQUEUE 0x00000009 /* Message Queue */
#define FSNODEFLAG_TYPE_SHM 0x0000000a /* Shared memory region */
#define FSNODEFLAG_TYPE_MTD 0x0000000b /* Named MTD driver */
#define FSNODEFLAG_TYPE_SOFTLINK 0x0000000c /* Soft link */
#define FSNODEFLAG_DELETED 0x00000010 /* Unlinked */
#define INODE_IS_TYPE(i,t) \
(((i)->i_flags & FSNODEFLAG_TYPE_MASK) == (t))
#define INODE_IS_SPECIAL(i) \
(((i)->i_flags & FSNODEFLAG_TYPE_SPECIAL) != 0)
## Impact
No function change
## Testing
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] acassis commented on a change in pull request #2591: fs: Remove the softlink check from unlink
Posted by GitBox <gi...@apache.org>.
acassis commented on a change in pull request #2591:
URL: https://github.com/apache/incubator-nuttx/pull/2591#discussion_r547925155
##########
File path: fs/vfs/fs_unlink.c
##########
@@ -114,13 +114,7 @@ int unlink(FAR const char *pathname)
* or a soft link, then rm should remove the node.
*/
-#ifdef CONFIG_PSEUDOFS_SOFTLINKS
- /* A soft link is the only "specal" file that we can remove via unlink(). */
-
- if (!INODE_IS_SPECIAL(inode) || INODE_IS_SOFTLINK(inode))
-#else
if (!INODE_IS_SPECIAL(inode))
Review comment:
@xiaoxiang781216 FSNODEFLAG_TYPE_SOFTLINK is a type of FSNODEFLAG_TYPE_SPECIAL so the code inside the if() will not run. Did you test it with CONFIG_PSEUDOFS_SOFTLINKS ?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 closed pull request #2591: fs: Remove the softlink check from unlink
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 closed pull request #2591:
URL: https://github.com/apache/incubator-nuttx/pull/2591
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #2591: fs: Remove the softlink check from unlink
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #2591:
URL: https://github.com/apache/incubator-nuttx/pull/2591#discussion_r547962775
##########
File path: fs/vfs/fs_unlink.c
##########
@@ -114,13 +114,7 @@ int unlink(FAR const char *pathname)
* or a soft link, then rm should remove the node.
*/
-#ifdef CONFIG_PSEUDOFS_SOFTLINKS
- /* A soft link is the only "specal" file that we can remove via unlink(). */
-
- if (!INODE_IS_SPECIAL(inode) || INODE_IS_SOFTLINK(inode))
-#else
if (!INODE_IS_SPECIAL(inode))
Review comment:
@acassis, you are right. I misunderstand the logic. The change is wrong, I will abandon it.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org