[pbs-devel] applied: [PATCH proxmox-backup 2/2] fix #2904: zpool status: parse vdevs with state but without statistics

Fabian Grünbichler f.gruenbichler at proxmox.com
Fri Aug 14 13:01:03 CEST 2020


On July 30, 2020 10:02 am, Dominik Csapak wrote:
> some vdevs (e.g. spares) have a 'state' (e.g. AVAIL), but
> not statistics like READ/WRITE/etc.
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  src/tools/disks/zpool_status.rs | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/src/tools/disks/zpool_status.rs b/src/tools/disks/zpool_status.rs
> index 8971d905..41b8a39c 100644
> --- a/src/tools/disks/zpool_status.rs
> +++ b/src/tools/disks/zpool_status.rs
> @@ -67,6 +67,19 @@ fn parse_zpool_status_vdev(i: &str) -> IResult<&str, ZFSPoolVDevState> {
>      }
>  
>      let (i, state) = preceded(multispace1, notspace1)(i)?;
> +    if let Ok((n, _)) = preceded(multispace0, line_ending)(i) { // spares
> +        let vdev = ZFSPoolVDevState {
> +            name: vdev_name.to_string(),
> +            lvl: indent_level,
> +            state: Some(state.to_string()),
> +            read: None,
> +            write: None,
> +            cksum: None,
> +            msg: None,
> +        };
> +        return Ok((n, vdev));
> +    }
> +
>      let (i, read) = preceded(multispace1, parse_u64)(i)?;
>      let (i, write) = preceded(multispace1, parse_u64)(i)?;
>      let (i, cksum) = preceded(multispace1, parse_u64)(i)?;
> -- 
> 2.20.1
> 
> 
> 
> _______________________________________________
> pbs-devel mailing list
> pbs-devel at lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
> 
> 
> 





More information about the pbs-devel mailing list