@@ -180,7 +180,7 @@ static int container_setup_volume(struct hyper_container *container)
180
180
181
181
if (vol -> readonly &&
182
182
mount (volume , mountpoint , NULL , MS_BIND | MS_REMOUNT | MS_RDONLY , NULL ) < 0 ) {
183
- perror ("mount fsmap failed" );
183
+ perror ("mount volume ro failed" );
184
184
return -1 ;
185
185
}
186
186
@@ -203,7 +203,7 @@ static int container_setup_volume(struct hyper_container *container)
203
203
if (st .st_mode & S_IFDIR ) {
204
204
if (hyper_mkdir (mountpoint , 0755 ) < 0 ) {
205
205
perror ("create map dir failed" );
206
- continue ;
206
+ return -1 ;
207
207
}
208
208
if (map -> docker ) {
209
209
/* converted from volume */
@@ -212,28 +212,30 @@ static int container_setup_volume(struct hyper_container *container)
212
212
if (container -> initialize &&
213
213
(container_populate_volume (mountpoint , volume ) < 0 )) {
214
214
fprintf (stderr , "fail to populate volume %s\n" , mountpoint );
215
- continue ;
215
+ return -1 ;
216
216
}
217
217
}
218
218
} else {
219
219
int fd = open (mountpoint , O_CREAT |O_WRONLY , 0755 );
220
220
if (fd < 0 ) {
221
221
perror ("create map file failed" );
222
- continue ;
222
+ return -1 ;
223
223
}
224
224
close (fd );
225
225
}
226
226
227
227
if (mount (src , mountpoint , NULL , MS_BIND , NULL ) < 0 ) {
228
228
perror ("mount fsmap failed" );
229
- continue ;
229
+ return -1 ;
230
230
}
231
231
232
232
if (map -> readonly == 0 )
233
233
continue ;
234
234
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
+ }
237
239
}
238
240
239
241
return 0 ;
0 commit comments