@@ -154,7 +154,7 @@ async fn mount_handler(
154154 } ;
155155
156156 let store_path = PathBuf :: from ( store_path) . join ( & temp_hash) ;
157- let _ = state. fuse . overlay_mount ( inode, store_path, false ) . await ;
157+ let _ = state. fuse . overlay_mount ( inode, store_path, false ) . await ;
158158 let mount_info = MountInfo {
159159 hash : temp_hash. clone ( ) ,
160160 path : mono_path. clone ( ) ,
@@ -174,10 +174,15 @@ async fn mount_handler(
174174 }
175175
176176 if let Some ( m) = & req. mr {
177-
177+ let mr_store_path = PathBuf :: from ( store_path ) . join ( "mr" ) ;
178178 // if mr is provided, we need to fetch the mr info from mono.
179- mr:: build_mr_layer ( m, store_path. into ( ) ) . await . unwrap ( ) ;
180-
179+ if let Err ( e) = mr:: build_mr_layer ( m, mr_store_path) . await {
180+ return axum:: Json ( MountResponse {
181+ status : FAIL . into ( ) ,
182+ mount : MountInfo :: default ( ) ,
183+ message : format ! ( "Failed to build mr layer: {e}" ) ,
184+ } ) ;
185+ }
181186 }
182187
183188 // fetch the dionary node info from mono.
@@ -186,7 +191,10 @@ async fn mount_handler(
186191 let store_path = PathBuf :: from ( store_path) . join ( & work_dir. hash ) ;
187192 // checkout / mount this dictionary.
188193
189- let _ = state. fuse . overlay_mount ( inode, store_path, false ) . await ;
194+ let _ = state
195+ . fuse
196+ . overlay_mount ( inode, store_path, req. mr . is_some ( ) )
197+ . await ;
190198
191199 let mount_info = MountInfo {
192200 hash : work_dir. hash ,
0 commit comments