-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible OSAL bug in OS_FileSysAddFixedMap not allowing FS_BASED mapping on VxWorks #580
Comments
Hm, after a code change, it still fails to read /cf/cfe_es_startup.scr due to the OS_FILESYS_FLAG_IS_MOUNTED_VIRTUAL flag not being set (checked in OS_FileSys_FindVirtMountPoint). Ultimately I had to work around this by forcing OS_FileSysMountVolume_Impl to always return success and mapping '/cf' to '/cf' instead of '/' to '/'. |
It looks like there's a related problem w/ running this on Linux too off of an NFS mounted home directory: |
Starting to look into this .... First and foremost - the design of the OSAL virtual file system is rather simplistic in nature (always has been). The virtual mount points are all expected to be single names immediately off the root VFS (e.g. Is there a reason that you can't make all the virtual mount dirs fit the expected pattern in your system? Perhaps this is a documentation issue - maybe it should be clearer what the virtual mount points are supposed to be? |
NOTE: it is possible to map the real root fs - just not hte virtual root fs. For instance:
should map the virtual |
The intent was to map I think JSC just worked around all of this by copying everything to ramdisk and mapping that as Another related problem, perhaps separate issue, is |
Dug into this again over the past week - and I can confirm a discrepancy here in how VxWorks and POSIX are handling FS_BASED mounts, with respect to the existence of the mount point directory. In POSIX, if the mount point does not exist, it will be created as part of At any rate, I will update the |
The mount/unmount implementation was not really checking for and handling this mapping type. To be consistent with POSIX it should also create a directory if it does not already exist.
The mount/unmount implementation was not really checking for and handling this mapping type. To be consistent with POSIX it should also create a directory if it does not already exist.
Fix #580, improve FS_BASED mounts on VxWorks
Adding a note that the fix doesn't resolve the case where the directory is on a netdrv filesystem (i.e. FTP), since stat() on netdrv directories fail, due to a vxWorks limitation, and don't know of a clean solution for that (so not reopening/creating another ticket). Workaround would be to have a boot script or usrAppInit copy the files to a directory on ramfs and map that. The default SP0 PSP maps /ram0/cf as /cf which sidesteps the issue. |
One possibility that crossed my mind is to simply skip the "stat" altogether and just call |
Added CFE_OMIT_DEPRECATED_6_7 just to be consistent Also fix nasa#552 - removes non-existent codes
…r-codes Fix nasa#580, Deprecate CFE_OS_ abstracted error codes
Describe the bug
Unable to add a arbitrary filesystem path mappings with OS_FileSysAddFixedMap
To Reproduce
Call OS_FileSysAddFixedMap w/ parameters &fsid,"/", "/", and it'll fail
Expected behavior
Entry added to OS_filesys_table
Code snips
It looks like the error code from line 516 is propagated improperly to line 530 instead of just being used to set flags on 524, causing the finalization step to fail.
osal/src/os/shared/src/osapi-filesys.c
Lines 511 to 530 in 9c74b1b
System observed on:
Additional context
Attempting to add a mapping to / for netbooting off of FTP on SP0-s PSP. Mapping /cf/ to /cf/ used to work earlier this year. In addition, OS_FileSys_FindVirtMountPoint appears to fail to map to "/" if it's in the table (although I suppose it's not desirable to map / in production anyway, since it'd override all other mappings).
Reporter Info
John N Pham, Northrop Grumman
The text was updated successfully, but these errors were encountered: