Skip to content

Commit

Permalink
Fix #180 (Potential kernel panic when running a container with corrup…
Browse files Browse the repository at this point in the history
…ted ext filesystem)
  • Loading branch information
gmkurtzer committed Aug 4, 2016
1 parent 03d130b commit caa7046
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mounts.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ int mount_image(char * loop_device, char * mount_point, int writable) {

if ( writable > 0 ) {
message(DEBUG, "Trying to mount read/write as ext4 with discard option\n");
if ( mount(loop_device, mount_point, "ext4", MS_NOSUID, "discard") < 0 ) {
if ( mount(loop_device, mount_point, "ext4", MS_NOSUID, "discard,errors=remount-ro") < 0 ) {
message(DEBUG, "Trying to mount read/write as ext4 without discard option\n");
if ( mount(loop_device, mount_point, "ext4", MS_NOSUID, "") < 0 ) {
if ( mount(loop_device, mount_point, "ext4", MS_NOSUID, "errors=remount-ro") < 0 ) {
message(DEBUG, "Trying to mount read/write as ext3\n");
if ( mount(loop_device, mount_point, "ext3", MS_NOSUID, "") < 0 ) {
if ( mount(loop_device, mount_point, "ext3", MS_NOSUID, "errors=remount-ro") < 0 ) {
message(ERROR, "Failed to mount (rw) '%s' at '%s': %s\n", loop_device, mount_point, strerror(errno));
ABORT(255);
}
Expand Down

0 comments on commit caa7046

Please sign in to comment.