summaryrefslogtreecommitdiff
path: root/components/dfs/src
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2017-12-05 20:16:34 +0800
committerBernard Xiong <[email protected]>2017-12-05 20:16:34 +0800
commit9508b0e650531e8f1ffed1f11282b7365b2863f1 (patch)
tree18cdcc0628d9596d39017c662711c5f8370d8451 /components/dfs/src
parent5efea8ddb6bb3ed06f693f076d3dd9bf1c1ac3fc (diff)
fix the fs type search issue in mkfs.
Diffstat (limited to 'components/dfs/src')
-rw-r--r--components/dfs/src/dfs_fs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/components/dfs/src/dfs_fs.c b/components/dfs/src/dfs_fs.c
index 0e103fba44..f6c210ddb0 100644
--- a/components/dfs/src/dfs_fs.c
+++ b/components/dfs/src/dfs_fs.c
@@ -23,6 +23,7 @@
* 2010-06-30 Bernard Optimize for RT-Thread RTOS
* 2011-03-12 Bernard fix the filesystem lookup issue.
* 2017-11-30 Bernard fix the filesystem_operation_table issue.
+ * 2017-12-05 Bernard fix the fs type search issue in mkfs.
*/
#include <dfs_fs.h>
@@ -454,7 +455,7 @@ int dfs_mkfs(const char *fs_name, const char *device_name)
/* lock file system */
dfs_lock();
/* find the file system operations */
- for (index = 0; index < DFS_FILESYSTEM_TYPES_MAX; index ++)
+ for (index = 0; index <= DFS_FILESYSTEM_TYPES_MAX; index ++)
{
if (filesystem_operation_table[index] != NULL &&
strcmp(filesystem_operation_table[index]->name, fs_name) == 0)
@@ -462,7 +463,7 @@ int dfs_mkfs(const char *fs_name, const char *device_name)
}
dfs_unlock();
- if (index < DFS_FILESYSTEM_TYPES_MAX)
+ if (index <= DFS_FILESYSTEM_TYPES_MAX)
{
/* find file system operation */
const struct dfs_filesystem_ops *ops = filesystem_operation_table[index];