From nobody Mon Feb 9 21:19:35 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1603703631; cv=none; d=zohomail.com; s=zohoarc; b=eKFr31D3l9+w/2Oggfl9KZybgUBU0x5tshboYWmWrXzwBYXKILAAPg6pZqJNhKOIbLtUltIFFyTNh/7T5Ya2oQHMFcT6sxlOCTA5yed71akJHdBej0VuGYKUkgmAFJbSLlvyZwNOju66yLlHFaDi3OyhGkG3ZCIyfQX+3zgYlGc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603703631; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZSq8aaykDP1qqXLMQtSSJphelHz62lSdHw2BdhisVQc=; b=iJ2T0CYCH2DGdSEeA4bu0LIBN5PPtOMz7Jtn9SqkTS2OWcNtYiACIbK0/wAfYclXpmaqPj8bNSuPS280AMgHF5Zk9lXV+KHpXKxMuP6u6FBaIuK9WmhtmC8jNe5FGYo7UupZ7j19XPawzIeteJ9mQJ5qX/khsyBOnyZ+tj7zwak= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 16037036318441004.1312102623076; Mon, 26 Oct 2020 02:13:51 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.12083.31687 (Exim 4.92) (envelope-from ) id 1kWyZI-0004th-GP; Mon, 26 Oct 2020 09:13:32 +0000 Received: by outflank-mailman (output) from mailman id 12083.31687; Mon, 26 Oct 2020 09:13:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kWyZI-0004tU-Az; Mon, 26 Oct 2020 09:13:32 +0000 Received: by outflank-mailman (input) for mailman id 12083; Mon, 26 Oct 2020 09:13:30 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kWyZG-0004f1-RQ for xen-devel@lists.xenproject.org; Mon, 26 Oct 2020 09:13:30 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id b99fa3f3-aecd-408e-99f0-5f4902718482; Mon, 26 Oct 2020 09:13:21 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 2EA73B241; Mon, 26 Oct 2020 09:13:20 +0000 (UTC) Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kWyZG-0004f1-RQ for xen-devel@lists.xenproject.org; Mon, 26 Oct 2020 09:13:30 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id b99fa3f3-aecd-408e-99f0-5f4902718482; Mon, 26 Oct 2020 09:13:21 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 2EA73B241; Mon, 26 Oct 2020 09:13:20 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: b99fa3f3-aecd-408e-99f0-5f4902718482 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1603703600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZSq8aaykDP1qqXLMQtSSJphelHz62lSdHw2BdhisVQc=; b=u5w8r5XbLREuAI2PEahXh4vzIz3GETulgMztS2x23i1OOAkvALwTqoDwwSbJDENI3vb83/ hBXe3YC6srkKz0vdI9BE74zZtZaZGtmXYBAHCbjy8vY1r1x9dX46rpHHiZpOb6XLHFJDc1 PvBrHsDxHjQ71tzmGAvznsbtbzZamgQ= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Andrew Cooper , George Dunlap , Ian Jackson , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH 07/12] xen/hypfs: pass real failure reason up from hypfs_get_entry() Date: Mon, 26 Oct 2020 10:13:11 +0100 Message-Id: <20201026091316.25680-8-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201026091316.25680-1-jgross@suse.com> References: <20201026091316.25680-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) Content-Type: text/plain; charset="utf-8" Instead of handling all errors from hypfs_get_entry() as ENOENT pass up the real error value via ERR_PTR(). Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich --- xen/common/hypfs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xen/common/hypfs.c b/xen/common/hypfs.c index e655e8cfc7..97260bd4a3 100644 --- a/xen/common/hypfs.c +++ b/xen/common/hypfs.c @@ -182,7 +182,7 @@ static struct hypfs_entry *hypfs_get_entry_rel(struct h= ypfs_entry_dir *dir, while ( again ) { if ( dir->e.type !=3D XEN_HYPFS_TYPE_DIR ) - return NULL; + return ERR_PTR(-ENOENT); =20 if ( !*path ) return &dir->e; @@ -201,7 +201,7 @@ static struct hypfs_entry *hypfs_get_entry_rel(struct h= ypfs_entry_dir *dir, struct hypfs_entry_di= r, e); =20 if ( cmp < 0 ) - return NULL; + return ERR_PTR(-ENOENT); if ( !cmp && strlen(entry->name) =3D=3D name_len ) { if ( !*end ) @@ -216,13 +216,13 @@ static struct hypfs_entry *hypfs_get_entry_rel(struct= hypfs_entry_dir *dir, } } =20 - return NULL; + return ERR_PTR(-ENOENT); } =20 static struct hypfs_entry *hypfs_get_entry(const char *path) { if ( path[0] !=3D '/' ) - return NULL; + return ERR_PTR(-EINVAL); =20 return hypfs_get_entry_rel(&hypfs_root, path + 1); } @@ -446,9 +446,9 @@ long do_hypfs_op(unsigned int cmd, goto out; =20 entry =3D hypfs_get_entry(path); - if ( !entry ) + if ( IS_ERR(entry) ) { - ret =3D -ENOENT; + ret =3D PTR_ERR(entry); goto out; } =20 --=20 2.26.2