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/08/09 05:15:51 UTC
[GitHub] [incubator-nuttx] xiaoxiang781216 opened a new issue #1540: CROMFS implement "." and ".." in the wrong
xiaoxiang781216 opened a new issue #1540:
URL: https://github.com/apache/incubator-nuttx/issues/1540
"." and ".." shouldn't set LINK flag because LINK flag is only used for the soft link, not the hard link.
----------------------------------------------------------------
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] patacongo commented on issue #1540: CROMFS implement "." and ".." in the wrong
Posted by GitBox <gi...@apache.org>.
patacongo commented on issue #1540:
URL: https://github.com/apache/incubator-nuttx/issues/1540#issuecomment-671582638
> "." and ".." shouldn't set LINK flag because LINK flag is only used for the soft link, not the hard link.
@xiaoxiang781216 The root pseudo-filesystem does support soft links and should return S_IFLNK. Is this okay?
----------------------------------------------------------------
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 issue #1540: CROMFS implement "." and ".." in the wrong
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on issue #1540:
URL: https://github.com/apache/incubator-nuttx/issues/1540#issuecomment-671011866
BTW, it doesn't require to implement "." and ".." by adding the real entry into the file system, we can simulate them from readdir callback, like what Linux done:
https://github.com/torvalds/linux/search?q=%21dir_emit_dot&unscoped_q=%21dir_emit_dot
----------------------------------------------------------------
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] patacongo commented on issue #1540: CROMFS implement "." and ".." in the wrong
Posted by GitBox <gi...@apache.org>.
patacongo commented on issue #1540:
URL: https://github.com/apache/incubator-nuttx/issues/1540#issuecomment-671119833
The correct fix is not simply to change the flags, but instead to implement following the hardlinks. Both "." and ".." are hardlinks in CROMFS. For all hardlinks, the file system should follow the hardlink which may refer to a directory, a file, or another hardlink. When this finally resolves to a a directory or a file, then the correct type should be reported which may or may not a directory. In the case of the hardlinks "." and ".." will, of course be a directory, but it may not be a directory in the general hardlink case.
I verified this logic in ROMFS (and fixed a bug in ROMFS too). I will port the hard-link following logic into CROMFS in the next few days. See PR #1546 ... I will make CROMFS work just like this. I am only working part time these days, so it will take me some time to accomplish this.
Other file systems that don't support hardlinks can only fake the "." and ".." entries.
----------------------------------------------------------------
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 issue #1540: CROMFS implement "." and ".." in the wrong
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on issue #1540:
URL: https://github.com/apache/incubator-nuttx/issues/1540#issuecomment-671723185
> > "." and ".." shouldn't set LINK flag because LINK flag is only used for the soft link, not the hard link.
>
> @xiaoxiang781216 The root pseudo-filesystem does support soft links and should return S_IFLNK. Is this okay?
The soft link(the file data contain the path to the target) return S_IFLNK, the hard link(inode directly point to the target block) should resolve the link internally(don't set S_IFLNK). So, it's right behaviour that the root pseudo-filesystem return S_IFLNK because the link implemented by root pseduo filesystem contain the target path.
----------------------------------------------------------------
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] patacongo commented on issue #1540: CROMFS implement "." and ".." in the wrong
Posted by GitBox <gi...@apache.org>.
patacongo commented on issue #1540:
URL: https://github.com/apache/incubator-nuttx/issues/1540#issuecomment-671013304
Improving a correcting features is welcome. Removing them is totally unacceptable without broad concurrence from the team.
----------------------------------------------------------------
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] patacongo commented on issue #1540: CROMFS implement "." and ".." in the wrong
Posted by GitBox <gi...@apache.org>.
patacongo commented on issue #1540:
URL: https://github.com/apache/incubator-nuttx/issues/1540#issuecomment-671054089
There are lots of other issues with CROMFS hard links that also need to be addressed. The logic follows the hard links seems to be missing. It can probably be cloned from ROMFS function romfs_followhardlinks();
----------------------------------------------------------------
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 issue #1540: CROMFS implement "." and ".." in the wrong
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 closed issue #1540:
URL: https://github.com/apache/incubator-nuttx/issues/1540
----------------------------------------------------------------
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 issue #1540: CROMFS implement "." and ".." in the wrong
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on issue #1540:
URL: https://github.com/apache/incubator-nuttx/issues/1540#issuecomment-699594184
Fixed by #1554
----------------------------------------------------------------
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