From owner-freebsd-fs@FreeBSD.ORG Wed Jun 12 10:03:44 2013 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9D1311F7; Wed, 12 Jun 2013 10:03:44 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com [209.85.217.170]) by mx1.freebsd.org (Postfix) with ESMTP id E8EFA1E76; Wed, 12 Jun 2013 10:03:43 +0000 (UTC) Received: by mail-lb0-f170.google.com with SMTP id t13so3407885lbd.29 for ; Wed, 12 Jun 2013 03:03:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=PhSENIOZW89kxYWmWCiHOoqiJQlNeu7Eb253VXpuTYM=; b=NsdZGVfYlJ8EKsvNM6ThSOsVNXcfkVt1pyk8NdHNPwKws9GS/K1aoVdYh41OsOWtpn 00Kss3TaKG9QH7mHTIw6WAYJeVYGf9TqoU5J+gjBPonkt0Wb+Mhx3SsDCE8F6QN5h0FH 2hp+ezWq7dY3ze4C60/vyEdJTLMJPC/i4GuZMTAyoRtByPOxstYn+lNSIyp5B6redOqT a/9sLUE4zJMwLRI9DYYWzUKVp0yYz5nQED3MzalSlaZ1bgtGG10vUrnfO31/s0P02z8v BiRb/ZxvaPe7CGJDtldtbiVTAXegDAhMRAmoaiHdmXlDUNhpwdH2yvORvoG2W4Ei7A9U +7DQ== X-Received: by 10.112.181.71 with SMTP id du7mr10509975lbc.24.1371031416709; Wed, 12 Jun 2013 03:03:36 -0700 (PDT) Received: from localhost ([188.230.122.226]) by mx.google.com with ESMTPSA id n3sm2301111lag.9.2013.06.12.03.03.34 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 12 Jun 2013 03:03:35 -0700 (PDT) Date: Wed, 12 Jun 2013 13:03:33 +0300 From: Mikolaj Golub To: Jeremy Chadwick Subject: Re: hast: can't restore after disk failure Message-ID: <20130612100332.GB55502@gmail.com> References: <20130610201650.GA2823@gmail.com> <20130611060741.GA42231@gmail.com> <20130612084453.GA55502@gmail.com> <20130612093639.GA9219@icarus.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130612093639.GA9219@icarus.home.lan> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-fs@freebsd.org, Dmitry Morozovsky X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jun 2013 10:03:44 -0000 On Wed, Jun 12, 2013 at 02:36:39AM -0700, Jeremy Chadwick wrote: > I honestly cannot see how nv->nv_error (which is what nv_error() > returns) gets set to ENOENT within the function call stack: > > - metadata_read() is what prints the error (line 152 in nv.c) > - Error printing done by pjdlog_errno(), which uses the global errno > to print its errors > - nv = nv_ntoh(eb) > - nv_ntoh() sets nv->nv_error to 0 initially, but then calls > nv_validate() later on which can modify nv->error > - nv_validate() explicitly sets error (which later can get assigned > to nv->nv_error) to EINVAL in many cases, but not ENOENT. > > Therefore, I am honestly not sure how ENOENT gets returned to the user > in this case. It looks like it's a misleading errno and is probably > meant to be something else. If it's correct, I would absolutely love > for someone to show me how/where. nv_find() (which is used by nv_get_* functions) sets ENOENT when it fails. "No such file or directory" really looks confusing in this case. I am not sure what a code from errno.h would be better here though. ENOATTR? -- Mikolaj Golub