summaryrefslogtreecommitdiff
path: root/components/dfs
diff options
context:
space:
mode:
authorprife <[email protected]>2013-12-21 11:35:09 +0800
committerprife <[email protected]>2013-12-21 11:35:09 +0800
commit4f9dc273ec03c91d32a8762518c5491050b7cdc6 (patch)
tree613102be9cefc1817fdd6fbfff7d2ce0a74fea49 /components/dfs
parent27112267e968419c1d2ab47ea2456eb3d9b54598 (diff)
dfs: fix dfs_unmount bug
fix #211
Diffstat (limited to 'components/dfs')
-rw-r--r--components/dfs/src/dfs_fs.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/components/dfs/src/dfs_fs.c b/components/dfs/src/dfs_fs.c
index 770fd71cfb..4c5982cf3b 100644
--- a/components/dfs/src/dfs_fs.c
+++ b/components/dfs/src/dfs_fs.c
@@ -320,6 +320,7 @@ err1:
int dfs_unmount(const char *specialfile)
{
char *fullpath;
+ struct dfs_filesystem *iter;
struct dfs_filesystem *fs = RT_NULL;
fullpath = dfs_normalize_path(RT_NULL, specialfile);
@@ -333,7 +334,17 @@ int dfs_unmount(const char *specialfile)
/* lock filesystem */
dfs_lock();
- fs = dfs_filesystem_lookup(fullpath);
+ for (iter = &filesystem_table[0];
+ iter < &filesystem_table[DFS_FILESYSTEMS_MAX]; iter++)
+ {
+ /* check if the PATH is mounted */
+ if ((iter->path != NULL) && (strcmp(iter->path, fullpath) == 0))
+ {
+ fs = iter;
+ break;
+ }
+ }
+
if (fs == RT_NULL ||
fs->ops->unmount == RT_NULL ||
fs->ops->unmount(fs) < 0)