Skip to content

Commit

Permalink
Use errors=remount-ro mount option with ext3 filesystems only
Browse files Browse the repository at this point in the history
  • Loading branch information
cclerget committed Nov 27, 2019
1 parent e33f028 commit 37e0e30
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/pkg/util/fs/mount/mount_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,10 @@ func (p *Points) AddImage(tag AuthorizedTag, source string, dest string, fstype
return fmt.Errorf("invalid image size, zero length")
}
keyB64 := base64.StdEncoding.EncodeToString(key)
options = fmt.Sprintf("loop,offset=%d,sizelimit=%d,key=%s,errors=remount-ro", offset, sizelimit, keyB64)
options = fmt.Sprintf("loop,offset=%d,sizelimit=%d,key=%s", offset, sizelimit, keyB64)
if fstype == "ext3" {
options += ",errors=remount-ro"
}
return p.add(tag, source, dest, fstype, flags, options)
}

Expand Down

0 comments on commit 37e0e30

Please sign in to comment.