Explorar o código

fix:vfs没有正确unmount
https://gitee.com/openLuat/LuatOS/issues/ICYIJH

豆豆 hai 5 meses
pai
achega
22405068be
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      luat/vfs/luat_vfs.c

+ 4 - 1
luat/vfs/luat_vfs.c

@@ -137,7 +137,10 @@ int luat_fs_umount(luat_fs_conf_t *conf) {
             continue;
         if (strcmp(vfs.mounted[j].prefix, conf->mount_point) == 0) {
             // TODO 关闭对应的FD
-            return vfs.mounted[j].fs->opts.umount(vfs.mounted[j].userdata, conf);
+            int ret = vfs.mounted[j].fs->opts.umount(vfs.mounted[j].userdata, conf);
+            vfs.mounted[j].fs = NULL;
+            vfs.mounted[j].ok = 0;
+            return ret;
         }
     }
     LLOGE("no such mount point %s", conf->mount_point);