@@ -180,7 +180,7 @@ static int container_setup_volume(struct hyper_container *container)
180180
181181 if (vol -> readonly &&
182182 mount (volume , mountpoint , NULL , MS_BIND | MS_REMOUNT | MS_RDONLY , NULL ) < 0 ) {
183- perror ("mount fsmap failed" );
183+ perror ("mount volume ro failed" );
184184 return -1 ;
185185 }
186186
@@ -203,7 +203,7 @@ static int container_setup_volume(struct hyper_container *container)
203203 if (st .st_mode & S_IFDIR ) {
204204 if (hyper_mkdir (mountpoint , 0755 ) < 0 ) {
205205 perror ("create map dir failed" );
206- continue ;
206+ return -1 ;
207207 }
208208 if (map -> docker ) {
209209 /* converted from volume */
@@ -212,28 +212,30 @@ static int container_setup_volume(struct hyper_container *container)
212212 if (container -> initialize &&
213213 (container_populate_volume (mountpoint , volume ) < 0 )) {
214214 fprintf (stderr , "fail to populate volume %s\n" , mountpoint );
215- continue ;
215+ return -1 ;
216216 }
217217 }
218218 } else {
219219 int fd = open (mountpoint , O_CREAT |O_WRONLY , 0755 );
220220 if (fd < 0 ) {
221221 perror ("create map file failed" );
222- continue ;
222+ return -1 ;
223223 }
224224 close (fd );
225225 }
226226
227227 if (mount (src , mountpoint , NULL , MS_BIND , NULL ) < 0 ) {
228228 perror ("mount fsmap failed" );
229- continue ;
229+ return -1 ;
230230 }
231231
232232 if (map -> readonly == 0 )
233233 continue ;
234234
235- if (mount (src , mountpoint , NULL , MS_BIND | MS_REMOUNT | MS_RDONLY , NULL ) < 0 )
236- perror ("mount fsmap failed" );
235+ if (mount (src , mountpoint , NULL , MS_BIND | MS_REMOUNT | MS_RDONLY , NULL ) < 0 ) {
236+ perror ("mount fsmap ro failed" );
237+ return -1 ;
238+ }
237239 }
238240
239241 return 0 ;
0 commit comments