From owner-freebsd-current@freebsd.org Sat Sep 5 17:18:35 2020 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E1EA3D1616 for ; Sat, 5 Sep 2020 17:18:35 +0000 (UTC) (envelope-from grahamperrin@gmail.com) Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BkLqG3c3Mz4fgw; Sat, 5 Sep 2020 17:18:34 +0000 (UTC) (envelope-from grahamperrin@gmail.com) Received: by mail-wm1-x330.google.com with SMTP id b79so9538053wmb.4; Sat, 05 Sep 2020 10:18:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=amkjfTrKF57ydAs2cu5hklUu9UTXmkXT6xP/65BDNFU=; b=a/rDb7lyf/Gvyh765X6L4vnIB9mPqz6cBuPu6zVZpNsrVHVReRv1R/NsO582wxdQ9i 6qcchsqf3wi/1+9nO9Cp/wlg4WXYR542wbxx7nAUEVGgMf1roiWkSTQDRGs+SSULXlGm cwYSGMtme6u8AIhAfPn3lNAusSXNOZv/tfd3DB6dhY3ejX1MkuUAKnoj+dg91B/OAaOP lh6iRI8VbGlVGSrrK4vxFJ59AiQ+oEJWCD4CG7QhEYewud4rb+M+cEuouVUNdYkObBAJ joCA0GPquUnX2wi0wF1iiGO5bBecmWFF/nL7778foDJL5iXAvDDeNjyB859O3KO0mDHV Iksw== X-Gm-Message-State: AOAM532V23YhXChYEo1CM42z4RdVaK+KEoXHnzYdeEHt26rv6AlWviL6 7ggWQzbKfBDGzArgmcL07fhasv7l2ybijNNp X-Google-Smtp-Source: ABdhPJxDPfjrdV6qzzTeWOZZZRheP1H3NmOgnFGRD4hn3hlzxfX/zpd0ik56RljEpWgtq776lDteHg== X-Received: by 2002:a1c:7c13:: with SMTP id x19mr13246714wmc.45.1599326312467; Sat, 05 Sep 2020 10:18:32 -0700 (PDT) Received: from [192.168.1.12] (79-66-147-78.dynamic.dsl.as9105.com. [79.66.147.78]) by smtp.gmail.com with ESMTPSA id f1sm11585481wrx.75.2020.09.05.10.18.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 05 Sep 2020 10:18:31 -0700 (PDT) Subject: Re: suspend/resume versus OpenZFS on USB To: FreeBSD Current , Matthew Macy , Ryan Moeller Cc: Hans Petter Selasky References: <6824e9f5-0496-a9ba-9cf2-01a6c8b34a4e@selasky.org> <24c4f60d-d937-7763-9cea-697de75109a6@gmail.com> <7cd8c682-0c4b-c332-c6de-d17dccbd9672@selasky.org> From: Graham Perrin Message-ID: Date: Sat, 5 Sep 2020 18:18:29 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <7cd8c682-0c4b-c332-c6de-d17dccbd9672@selasky.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: 4BkLqG3c3Mz4fgw X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.61 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.53)[-0.532]; RECEIVED_SPAMHAUS_PBL(0.00)[79.66.147.78:received]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.08)[-1.083]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-0.995]; MIME_GOOD(-0.10)[text/plain]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::330:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-current] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Sep 2020 17:18:35 -0000 On 05/09/2020 10:26, Hans Petter Selasky wrote: > On 2020-09-05 11:00, Graham Perrin wrote: >> On 04/09/2020 09:01, Hans Petter Selasky wrote: >>> On 2020-09-04 01:42, Graham Perrin wrote: >>>> This week for the first time I toyed with OpenZFS on a USB device: >>>> a mobile hard disk drive connected to the dock of an HP EliteBook >>>> 8570p. >>>> >>>> A light test, with the pool imported but not writing to the dataset >>>> at suspend time. >>>> >>>> At resume time (22:31), the device was still physically connected >>>> but the pool suffered an I/O failure (and the keyboard and >>>> trackball on USB were unusable). >> … >>> We need output from "procstat -akk" to see where ZFS/USB is hanging. >>> >>> --HPS >> >> For test purposes I reproduced the behaviour with a different device, >> a USB flash drive (connected to the same dock). >> >> Attached: >> >> 2020-09-05 09:27:55 procstat -akk.txt >> >> – output from procstat -akk >> >> 2020-09-05 09:17:59 suspend 09:26:49 resume.txt >> >> – the output in context. >> >> Thank you >> >> Graham >> >> > > Hi, > > USB is not hanging. > > It looks like a problem with USB resume, that no devices are > recognized, until you re-plug them ... > > --HPS Hi If I export the pool before suspend, no problem at resume time. An alternative scenario, with the notebook removed from its dock. With nothing other than the USB device connected (at da0), if the pool is imported and online at suspend time, then at resume time: * the pool is SUSPENDED * da0p1 is shown as REMOVED * zpool clear followed by zpool scrub will lead to disappearance of the permanent errors, without physically touching the USB flash drive, however the resulting device is at da1. Example below. ---- root@momh167-gjp4-8570p:~ # zpool status -v usb   pool: usb  state: ONLINE   scan: scrub repaired 0B in 00:00:04 with 0 errors on Sat Sep  5 18:00:31 2020 config:         NAME        STATE     READ WRITE CKSUM         usb         ONLINE       0     0     0           da0p1     ONLINE       0     0     0 errors: No known data errors root@momh167-gjp4-8570p:~ # acpiconf -s 3 root@momh167-gjp4-8570p:~ # zpool status -v usb   pool: usb  state: SUSPENDED status: One or more devices are faulted in response to IO failures. action: Make sure the affected devices are connected, then run 'zpool clear'.    see: https://zfsonlinux.org/msg/ZFS-8000-HC   scan: scrub repaired 0B in 00:00:04 with 0 errors on Sat Sep  5 18:00:31 2020 config:         NAME        STATE     READ WRITE CKSUM         usb         UNAVAIL      0     0     0  insufficient replicas           da0p1     REMOVED      0     0     0 errors: List of errors unavailable: pool I/O is currently suspended root@momh167-gjp4-8570p:~ # zpool clear usb root@momh167-gjp4-8570p:~ # zpool status -v usb   pool: usb  state: ONLINE status: One or more devices has experienced an error resulting in data         corruption.  Applications may be affected. action: Restore the file in question if possible.  Otherwise restore the         entire pool from backup.    see: https://zfsonlinux.org/msg/ZFS-8000-8A   scan: scrub repaired 0B in 00:00:04 with 0 errors on Sat Sep  5 18:00:31 2020 config:         NAME        STATE     READ WRITE CKSUM         usb         ONLINE       0     0     0           da1p1     ONLINE       0     0     0 errors: Permanent errors have been detected in the following files:         :<0x0>         :<0x3d> root@momh167-gjp4-8570p:~ # zpool scrub usb root@momh167-gjp4-8570p:~ # zpool status -v usb   pool: usb  state: ONLINE   scan: scrub repaired 0B in 00:00:01 with 0 errors on Sat Sep  5 18:04:05 2020 config:         NAME        STATE     READ WRITE CKSUM         usb         ONLINE       0     0     0           da1p1     ONLINE       0     0     0 errors: No known data errors root@momh167-gjp4-8570p:~ # ls /dev/da* /dev/da0        /dev/da0p1      /dev/da1        /dev/da1p1 root@momh167-gjp4-8570p:~ #