From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <o.bektas@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id ED502695F7
 for <pve-devel@lists.proxmox.com>; Tue,  2 Mar 2021 13:36:43 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id D99CC2C576
 for <pve-devel@lists.proxmox.com>; Tue,  2 Mar 2021 13:36:13 +0100 (CET)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [212.186.127.180])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS id 16E252C56A
 for <pve-devel@lists.proxmox.com>; Tue,  2 Mar 2021 13:36:12 +0100 (CET)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id CCA1544756
 for <pve-devel@lists.proxmox.com>; Tue,  2 Mar 2021 13:36:11 +0100 (CET)
Date: Tue, 2 Mar 2021 13:33:55 +0100
From: Oguz Bektas <o.bektas@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Message-ID: <20210302123355.GA11423@gaia.proxmox.com>
Mail-Followup-To: Oguz Bektas <o.bektas@proxmox.com>,
 Proxmox VE development discussion <pve-devel@lists.proxmox.com>
References: <20210301135649.564191-1-o.bektas@proxmox.com>
 <00a8dc69-5e30-9a95-552e-d374656709ac@proxmox.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <00a8dc69-5e30-9a95-552e-d374656709ac@proxmox.com>
User-Agent: Mutt/1.10.1 (2018-07-13)
X-SPAM-LEVEL: Spam detection results:  0
 AWL 1.522 Adjusted score from AWL reputation of From: address
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 RCVD_IN_DNSWL_MED        -2.3 Sender listed at https://www.dnswl.org/,
 medium trust
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See
 http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more
 information. [proxmox.com, diskmanage.pm]
Subject: Re: [pve-devel] [PATCH storage] fix #3203: report smart status
 correctly
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Tue, 02 Mar 2021 12:36:44 -0000

hi,

On Tue, Mar 02, 2021 at 09:34:41AM +0100, Dominik Csapak wrote:
> On 3/1/21 14:56, Oguz Bektas wrote:
> > if the -a option isn't passed, -H might report a failing disk as
> > 'PASSED' even when the disk might be in a corrupted state.
> > 
> > Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
> > ---
> >   PVE/Diskmanage.pm | 5 +++--
> >   1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/PVE/Diskmanage.pm b/PVE/Diskmanage.pm
> > index 64bb813..d3c3365 100644
> > --- a/PVE/Diskmanage.pm
> > +++ b/PVE/Diskmanage.pm
> > @@ -95,8 +95,9 @@ sub get_smart_data {
> >   	    or die "failed to get nvme controller device for $disk\n");
> >       }
> > -    my $cmd = [$SMARTCTL, '-H'];
> > -    push @$cmd, '-A', '-f', 'brief' if !$healthonly;
> > +    my $cmd = [$SMARTCTL];
> > +    push @$cmd, '-H' if $healthonly;
> > +    push @$cmd, '-a', '-A', '-f', 'brief' if !$healthonly;
> >       push @$cmd, $disk;
> >       eval {
> > 
> 
> after looking at our code, this patch does not solve the issue the
> user in #3203 has
> 
> we purposely ignore the return value of smartctl except
> for sever smartctl errors (such as device open failed or faulty command
> line) and parse the status from the text itself
> 
> but the text (PASSED) does not change regardless if -H is given or not
> 
> the real fix for the issue is to start parsing the smart errors separately
> and show them to the user somehow

hmm yeah you're right, thanks!

> 
> while doing this, we should change our parser to use the '--json' flag
> of smartcl

i will take a look. like you also mentioned off-list we do this in
backup server code with the json flag, so it makes sense to do it here
as well

> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
>