From a208853cf80cf4a9e59811522c4671be81370ace Mon Sep 17 00:00:00 2001 From: Itxaka Date: Wed, 31 Jul 2024 15:41:20 +0200 Subject: [PATCH] Add discard flags on open Signed-off-by: Itxaka --- pkg/lib/unlock.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/lib/unlock.go b/pkg/lib/unlock.go index b3bd1177..155b91bd 100644 --- a/pkg/lib/unlock.go +++ b/pkg/lib/unlock.go @@ -130,7 +130,10 @@ func LuksUnlock(device, mapper, password string) error { return err } defer dev.Close() - + err = dev.FlagsAdd(luks.FlagAllowDiscards) + if err != nil { + return err + } err = dev.Unlock(0, []byte(password), mapper) if err != nil { return err