Skip to content

Commit 807f5a7

Browse files
committed
Mount overlaybd devices in journal mode
This is slower but safer. All writes will go through the journal.
1 parent 6a6545a commit 807f5a7

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

pkg/snapshot/overlay.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,6 +1579,7 @@ func (o *snapshotter) basedOnBlockDeviceMount(ctx context.Context, s storage.Sna
15791579
Options: []string{
15801580
rwflag,
15811581
"discard",
1582+
"data=journal",
15821583
},
15831584
},
15841585
}, nil

pkg/snapshot/storage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ func (o *snapshotter) attachAndMountBlockDevice(ctx context.Context, snID string
450450
} else {
451451
switch fstype {
452452
case "ext4":
453-
mountOpts = "discard"
453+
mountOpts = "discard,data=journal"
454454
case "xfs":
455455
mountOpts = "nouuid,discard"
456456
default:

0 commit comments

Comments
 (0)