mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: John Watts <contact@jookia.org>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v2] fs: nfs: Error if a port is unregistered
Date: Fri, 3 Feb 2023 09:00:49 +0100	[thread overview]
Message-ID: <20230203080049.GR13319@pengutronix.de> (raw)
In-Reply-To: <20230202112024.2458085-1-contact@jookia.org>

On Thu, Feb 02, 2023 at 10:20:24PM +1100, John Watts wrote:
> If a server doesn't provide a service the port lookup will return 0.
> 
> Check for this, return an appropriate error code and give a hint as to
> why this might be happening.
> 
> This was tested by running NFS with UDP disabled, which seems to be
> the default in Arch at least.
> 
> Signed-off-by: John Watts <contact@jookia.org>
> ---
> Changes v1 -> v2:
> - Added error message
> ---
>  fs/nfs.c | 6 ++++++
>  1 file changed, 6 insertions(+)

Applied, thanks

Sascha

> 
> diff --git a/fs/nfs.c b/fs/nfs.c
> index 446d0f7946..1a0b28442d 100644
> --- a/fs/nfs.c
> +++ b/fs/nfs.c
> @@ -571,6 +571,12 @@ static int rpc_lookup_req(struct nfs_priv *npriv, uint32_t prog, uint32_t ver)
>  
>  	nfs_free_packet(nfs_packet);
>  
> +	if (port == 0) {
> +		pr_warn("No UDP port for RPC program %i! "
> +		        "Is your NFS server TCP only?\n", prog);
> +		return -ENOENT;
> +	}
> +
>  	return port;
>  }
>  
> -- 
> 2.39.1
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



      reply	other threads:[~2023-02-03  8:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-01 22:34 [PATCH] " John Watts
2023-02-02  7:39 ` Sascha Hauer
2023-02-02  9:33   ` Jookia
2023-02-02  9:45     ` Ahmad Fatoum
2023-02-02 10:31       ` John Watts
2023-02-02 10:54         ` Ahmad Fatoum
2023-02-02 11:20 ` [PATCH v2] " John Watts
2023-02-03  8:00   ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230203080049.GR13319@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=contact@jookia.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox