From owner-freebsd-fs@freebsd.org Wed Oct 19 08:03:00 2016 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF097C18132 for ; Wed, 19 Oct 2016 08:03:00 +0000 (UTC) (envelope-from ardovm@yahoo.it) Received: from nm5-vm9.bullet.mail.ir2.yahoo.com (nm5-vm9.bullet.mail.ir2.yahoo.com [212.82.96.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D37DB50 for ; Wed, 19 Oct 2016 08:03:00 +0000 (UTC) (envelope-from ardovm@yahoo.it) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.it; s=s2048; t=1476864006; bh=9vosDVVzf2SOP3QlxRtjGdds7f+XxcqjFaDbal+y45M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=GLmEZsb2oVbfzrd3l615qB8L6b4p7RXiCerpdo6dUj5xpy9P1xIuzzrd+v7KOADB0LG7em99wJ7IFgAVUPP19QHCA9XxoLs2r/yaT1IL3JjM+QfXzYMOU3GZKubB+C0/Bu2A+RvJGo/DMOLiLZ59tgUS0S0gZWdV7EkOH/5uRpXNHGuquQp48C8m3C0kcyE1SVXY5+ia9mXFq3lsAGfRMgi9ljT5sxbSU3DsMr9ErOCo8FrRjVSrCoKSPlmtMHx9jVoGHqU8Orqi9QqIgNK/xRaa4woJfkgI6+crd9UvfNeKGpl4vSDxhNJaoP+iBsQabeZm9vyJZzyqG7Du/8uzvA== Received: from [212.82.98.53] by nm5.bullet.mail.ir2.yahoo.com with NNFMP; 19 Oct 2016 08:00:06 -0000 Received: from [46.228.39.85] by tm6.bullet.mail.ir2.yahoo.com with NNFMP; 19 Oct 2016 08:00:06 -0000 Received: from [127.0.0.1] by smtp122.mail.ir2.yahoo.com with NNFMP; 19 Oct 2016 08:00:06 -0000 X-Yahoo-Newman-Id: 957286.50208.bm@smtp122.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: AbmggVcVM1kvYkKbj7Fq0HJli1J936_mLhCcOEd2aaOleE0 pMOOU52F.lTR3eLcwRQHUkn8yP5.5Hxqaw_qNdZo2m1pslYaOXpOvv7cx9sw WXlasVNHflsyaJyPTZPbK1bOuMzqheebeJ6.ROVBp5pzrR9C7jVVqWL7fEbQ 7Gs75pNWIn9f4hKY.WFea.uEMy2.kt01M6i60G01zck9lVfOq3odI0.rFSAk b7e.czuXWP47SGcMWDrcXidk2eSPaWMhqhGtSGGWXEG6zolFTfcJWxOF_dUj F54CmYDQIyEenxNNp8leSrDbnp7w0w69piFvTS5999WdRQiKXMcFjDFN.Y6e 8d1bjAcPC6tYvM53H9OM.Wy.NQmGURWuKLfJZp69e38CDCTPdIvzG17fQ2pX 7VQPI4mZRO2DLPqz94A6Yb_HnrrCPkOiFyAV.0XflCqRduhA.6KNdsqYG0MW NAdspcHGC3x4lC0pSpBi4tRtjBAPoduZaaOzrZVYQLB.uwBfj0Uz9iLPAv52 XdOJauKKJeE9Sj63ynHbBRdpUPjZRd3oskEDKtsSbCT__GFh7 X-Yahoo-SMTP: WU.IBxeswBAAnLcBZV3tEZIK0A-- Received: by nuvolo.localdomain (Postfix, from userid 1001) id 10AFA1AF109; Wed, 19 Oct 2016 10:00:05 +0200 (CEST) Date: Wed, 19 Oct 2016 10:00:05 +0200 From: Arrigo Marchiori To: Poul-Henning Kamp Cc: Arrigo Marchiori via freebsd-fs Subject: Re: Random truncated files on USB hard disk with timeouts; how to debug? Message-ID: <20161019080005.GD93031@nuvolo> References: <20161018152715.GC89691@nuvolo> <51997.1476812624@critter.freebsd.dk> <20161019062812.GA93031@nuvolo> <7759.1476858801@critter.freebsd.dk> <20161019064315.GB93031@nuvolo> <7924.1476861738@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <7924.1476861738@critter.freebsd.dk> User-Agent: Mutt/1.7.0 (2016-08-17) X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 08:03:01 -0000 Hello Poul-Henning, On Wed, Oct 19, 2016 at 07:22:18AM +0000, Poul-Henning Kamp wrote: > -------- > In message <20161019064315.GB93031@nuvolo>, Arrigo Marchiori writes: > > >> Y-cables are a big warning sign. > >> > >> You can try plugging the "power-only" plug into a high quality 1 > >> ampere USB charger, but that is no guarantee for success. > > > >Yes, I also thought so at first. > > > >But I also believe that if anything goes wrong at the hardware level, > >I should get a big warning from the kernel, instead of a funny > >apparently-truncated file, that returns to be readable at next > >reboot...? > > Only if the drive finds out something is wrong and tells the kernel. > > If the drive has bad power supply, that may not happen. Yes, I understand. But, forgive me for insisting: there is an inconsistency that is _at filesystem level_ and _temporary_, and this really puzzles me. If there was an undetected problem when writing, I would expect garbage to be written instead of the actual data. Or, no data at all. But the outcome should be that such data should be _unrecoverable_ afterwards. Instead, the file is found and probably correct at next reboot! Last one was a Java source file; if it had errors internally I would have expected the port not to compile. If there was a problem when reading, should the kernel not detect an inconsistency in the data? Like a failed checksum? Because I think it does: read(2) returns zero bytes, not garbage. It just happened now, that another compilation filed. I cleaned, repeated and it worked, without need to reboot. So, the ``funny'' file seems to be deletable. Please correct me if I am wrong. And thank you for your replies so far! Best regards, -- rigo http://rigo.altervista.org