<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 22, 2020 at 10:54 AM Richard W.M. Jones <<a href="mailto:rjones@redhat.com">rjones@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, Jan 22, 2020 at 10:16:14AM +0100, Jan Synacek wrote:<br>
> From: Jan Synacek <<a href="mailto:jan.synacek@redhat.com" target="_blank">jan.synacek@redhat.com</a>><br>
> <br>
> ---<br>
>  daemon/<a href="http://listfs.ml" rel="noreferrer" target="_blank">listfs.ml</a>          | 19 ++++++++++++++++---<br>
>  daemon/luks.c             |  9 +++++----<br>
>  generator/<a href="http://actions_core.ml" rel="noreferrer" target="_blank">actions_core.ml</a> |  3 ++-<br>
>  gobject/Makefile.inc      |  2 ++<br>
>  inspector/inspector.c     |  2 +-<br>
>  sparsify/<a href="http://in_place.ml" rel="noreferrer" target="_blank">in_place.ml</a>      |  2 +-<br>
>  6 files changed, 27 insertions(+), 10 deletions(-)<br>
> <br>
> diff --git a/daemon/<a href="http://listfs.ml" rel="noreferrer" target="_blank">listfs.ml</a> b/daemon/<a href="http://listfs.ml" rel="noreferrer" target="_blank">listfs.ml</a><br>
> index bf4dca6d4..a618513e8 100644<br>
> --- a/daemon/<a href="http://listfs.ml" rel="noreferrer" target="_blank">listfs.ml</a><br>
> +++ b/daemon/<a href="http://listfs.ml" rel="noreferrer" target="_blank">listfs.ml</a><br>
> @@ -19,6 +19,7 @@<br>
>  open Printf<br>
>  <br>
>  open Std_utils<br>
> +open Utils<br>
>  <br>
>  (* Enumerate block devices (including MD, LVM, LDM and partitions) and use<br>
>   * vfs-type to check for filesystems on devices.  Some block devices cannot<br>
> @@ -30,6 +31,7 @@ let rec list_filesystems () =<br>
>  <br>
>    (* Devices. *)<br>
>    let devices = Devsparts.list_devices () in<br>
> +<br>
<br>
Did you mean to add a blank line here?<br></blockquote><div><br></div><div style="font-family:monospace,monospace" class="gmail_default">No, I didn't notice. I'll fix it.</div><div style="font-family:monospace,monospace" class="gmail_default"></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
>    let devices = List.filter is_not_partitioned_device devices in<br>
>    let ret = List.filter_map check_with_vfs_type devices in<br>
>  <br>
> @@ -144,9 +146,20 @@ and check_with_vfs_type device =<br>
>    else if String.is_suffix vfs_type "_member" then<br>
>      None<br>
>  <br>
> -  (* Ignore LUKS-encrypted partitions.  These are also containers, as above. *)<br>
> -  else if vfs_type = "crypto_LUKS" then<br>
> -    None<br>
> +  (* If a LUKS-encrypted partition had been opened, include the corresponding<br>
> +   * device mapper filesystem path. *)<br>
> +  else if vfs_type = "crypto_LUKS" then (<br>
> +    let out = command "lsblk" ["-n"; "-l"; "-o"; "NAME"; device] in<br>
> +      (* Example output: #lsblk -n -l -o NAME /dev/sda5<br>
> +       * sda5<br>
> +       * lukssda5<br>
> +       *)<br>
> +      match String.trimr @@ snd @@  String.split "\n" out with<br>
> +      | "" -> None<br>
> +      | part -><br>
> +        let mnt = Mountable.of_path @@ "/dev/mapper/" ^ part in<br>
> +          Some [mnt, Blkid.vfs_type mnt]<br>
<br>
Now Some doesn't line up with let :-/<br></blockquote><div><br></div><div><div style="font-family:monospace,monospace" class="gmail_default">Will fix.</div></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
>    { defaults with<br>
>      name = "luks_open"; added = (1, 5, 1);<br>
> -    style = RErr, [String (Device, "device"); String (Key, "key"); String (PlainString, "mapname")], [];<br>
> +    style = RErr, [String (Device, "device"); String (Key, "key"); String (PlainString, "mapname")], [OBool "allowdiscards"];<br>
> +    once_had_no_optargs = true;<br>
>      optional = Some "luks";<br>
>      shortdesc = "open a LUKS-encrypted block device";<br>
>      longdesc = "\<br>
<br>
This is fine.<br>
<br>
The rest of this patch is fine.<br>
<br>
I'm losing track of what order these patches would be applied<br>
in order to preserve git bisection.  Maybe submit the whole series<br>
in one go for version 2?<br></blockquote><div><br></div><div><div style="font-family:monospace,monospace" class="gmail_default">The first to apply should be the one that patches the common/ subrepo. I'll submit them all at once next time.</div><div style="font-family:monospace,monospace" class="gmail_default"><br></div><div style="font-family:monospace,monospace" class="gmail_default">And again, I'm sorry for the mess with the incorrect submissions. I didn't notice that my patches had a wrong address in them.</div></div><div> </div><div><div style="font-family:monospace,monospace" class="gmail_default">Thank you for the review!<br></div></div></div>-- <br><div dir="ltr" class="gmail_signature">Jan Synacek<br>Software Engineer, Red Hat</div></div>