fs/mount: Properly handle missing FS on the supported list
Instead of reporting the failure to find a given FS, nx_mount was reporting a failure to find the block driver, even when the actual block driver exists. Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
This commit is contained in:
parent
c019533d7a
commit
3819d93b4e
@ -266,11 +266,9 @@ int nx_mount(FAR const char *source, FAR const char *target,
|
|||||||
FAR const void *data)
|
FAR const void *data)
|
||||||
{
|
{
|
||||||
#if defined(BDFS_SUPPORT) || defined(MDFS_SUPPORT) || defined(NODFS_SUPPORT)
|
#if defined(BDFS_SUPPORT) || defined(MDFS_SUPPORT) || defined(NODFS_SUPPORT)
|
||||||
#if defined(BDFS_SUPPORT) || defined(MDFS_SUPPORT)
|
|
||||||
FAR struct inode *drvr_inode = NULL;
|
FAR struct inode *drvr_inode = NULL;
|
||||||
#endif
|
|
||||||
FAR struct inode *mountpt_inode;
|
FAR struct inode *mountpt_inode;
|
||||||
FAR const struct mountpt_operations *mops;
|
FAR const struct mountpt_operations *mops = NULL;
|
||||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||||
struct inode_search_s desc;
|
struct inode_search_s desc;
|
||||||
#endif
|
#endif
|
||||||
@ -283,13 +281,14 @@ int nx_mount(FAR const char *source, FAR const char *target,
|
|||||||
|
|
||||||
/* Find the specified filesystem. Try the block driver filesystems first */
|
/* Find the specified filesystem. Try the block driver filesystems first */
|
||||||
|
|
||||||
#ifdef BDFS_SUPPORT
|
|
||||||
if (source != NULL &&
|
if (source != NULL &&
|
||||||
find_blockdriver(source, mountflags, &drvr_inode) >= 0)
|
find_blockdriver(source, mountflags, &drvr_inode) >= 0)
|
||||||
{
|
{
|
||||||
/* Find the block based file system */
|
/* Find the block based file system */
|
||||||
|
|
||||||
|
#ifdef BDFS_SUPPORT
|
||||||
mops = mount_findfs(g_bdfsmap, filesystemtype);
|
mops = mount_findfs(g_bdfsmap, filesystemtype);
|
||||||
|
#endif /* BDFS_SUPPORT */
|
||||||
if (mops == NULL)
|
if (mops == NULL)
|
||||||
{
|
{
|
||||||
ferr("ERROR: Failed to find block based file system %s\n",
|
ferr("ERROR: Failed to find block based file system %s\n",
|
||||||
@ -299,14 +298,14 @@ int nx_mount(FAR const char *source, FAR const char *target,
|
|||||||
goto errout_with_inode;
|
goto errout_with_inode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if (source != NULL &&
|
||||||
#endif /* BDFS_SUPPORT */
|
(ret = find_mtddriver(source, &drvr_inode)) >= 0)
|
||||||
#ifdef MDFS_SUPPORT
|
|
||||||
if (source != NULL && (ret = find_mtddriver(source, &drvr_inode)) >= 0)
|
|
||||||
{
|
{
|
||||||
/* Find the MTD based file system */
|
/* Find the MTD based file system */
|
||||||
|
|
||||||
|
#ifdef MDFS_SUPPORT
|
||||||
mops = mount_findfs(g_mdfsmap, filesystemtype);
|
mops = mount_findfs(g_mdfsmap, filesystemtype);
|
||||||
|
#endif /* MDFS_SUPPORT */
|
||||||
if (mops == NULL)
|
if (mops == NULL)
|
||||||
{
|
{
|
||||||
ferr("ERROR: Failed to find MTD based file system %s\n",
|
ferr("ERROR: Failed to find MTD based file system %s\n",
|
||||||
@ -317,7 +316,6 @@ int nx_mount(FAR const char *source, FAR const char *target,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif /* MDFS_SUPPORT */
|
|
||||||
#ifdef NODFS_SUPPORT
|
#ifdef NODFS_SUPPORT
|
||||||
if ((mops = mount_findfs(g_nonbdfsmap, filesystemtype)) != NULL)
|
if ((mops = mount_findfs(g_nonbdfsmap, filesystemtype)) != NULL)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user