[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 2/9] cryptodisk: Refactor to discard have_it global

From: Daniel Kiper
Subject: Re: [PATCH v5 2/9] cryptodisk: Refactor to discard have_it global
Date: Thu, 16 Dec 2021 20:11:39 +0100
User-agent: NeoMutt/20170113 (1.7.2)

On Thu, Dec 09, 2021 at 11:14:51AM -0600, Glenn Washburn wrote:
> The global "have_it" was never used by the crypto-backends, but was used to
> determine if a crypto-backend successfully mounted a cryptodisk with a given
> uuid. This is not needed however, because grub_device_iterate() will return
> 1 if and only if grub_cryptodisk_scan_device() returns 1. And
> grub_cryptodisk_scan_device() will now only return 1 if a search_uuid has
> been specified and a cryptodisk was successfully setup by a crypto-backend or
> a cryptodisk of the requested uuid is already open.
> To implement this grub_cryptodisk_scan_device_real is modified to return a
> cryptodisk or NULL on failure and having the appropriate grub_errno set to
> indicated failure. Note that grub_cryptodisk_scan_device_real will fail now
> with a new errno GRUB_ERR_BAD_MODULE when none of the cryptodisk backend
> modules succeed in identifying the source disk.
> With this change grub_device_iterate() will return 1 when a crypto device is
> successfully decrypted or when the source device has already been
> successfully opened. Prior to this change, trying to mount an already
> successfully opened device would trigger an error with the message "no such
> cryptodisk found", which is at best misleading. The mount should silently
> succeed in this case, which is what happens with this patch.
> Signed-off-by: Glenn Washburn <>

Reviewed-by: Daniel Kiper <>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]