diff mbox

[-,nfs-utils] gssd: suppress error message if rpc_pipefs dir disappears.

Message ID 20130902145750.357c303a@notabene.brown
State New, archived
Headers show

Commit Message

NeilBrown Sept. 2, 2013, 4:57 a.m. UTC
It is possible for a race to cause a name to appear when an rpc_pipefs
dir is scanned but to no longer be present when we try to open it.

So if the error is ENOENT, don't complain.

This is similar to

commit 5ac9bcfd820f09af4d3f87f1f7346d896f70bc9a
Author: David Jeffery <djeffery@redhat.com>
Date:   Wed Jan 16 15:21:55 2013 -0500

    rpc.idmapd: Ignore open failures in dirscancb()

which addressed a similar issue in idmapd.

Signed-off-by: NeilBrown <neilb@suse.de>

Comments

Steve Dickson Sept. 5, 2013, 4:02 p.m. UTC | #1
On 02/09/13 00:57, NeilBrown wrote:
> It is possible for a race to cause a name to appear when an rpc_pipefs
> dir is scanned but to no longer be present when we try to open it.
> 
> So if the error is ENOENT, don't complain.
> 
> This is similar to
> 
> commit 5ac9bcfd820f09af4d3f87f1f7346d896f70bc9a
> Author: David Jeffery <djeffery@redhat.com>
> Date:   Wed Jan 16 15:21:55 2013 -0500
> 
>     rpc.idmapd: Ignore open failures in dirscancb()
> 
> which addressed a similar issue in idmapd.
> 
> Signed-off-by: NeilBrown <neilb@suse.de>
Committed! 

steved.

> 
> diff --git a/utils/gssd/gssd_proc.c b/utils/gssd/gssd_proc.c
> index b7e2bbb..2d3dbec 100644
> --- a/utils/gssd/gssd_proc.c
> +++ b/utils/gssd/gssd_proc.c
> @@ -467,8 +467,9 @@ process_clnt_dir(char *dir, char *pdir)
>  	}
>  	sprintf(clp->dirname, "%s/%s", pdir, dir);
>  	if ((clp->dir_fd = open(clp->dirname, O_RDONLY)) == -1) {
> -		printerr(0, "ERROR: can't open %s: %s\n",
> -			 clp->dirname, strerror(errno));
> +		if (errno != ENOENT)
> +			printerr(0, "ERROR: can't open %s: %s\n",
> +				 clp->dirname, strerror(errno));
>  		goto fail_destroy_client;
>  	}
>  	fcntl(clp->dir_fd, F_SETSIG, DNOTIFY_SIGNAL);
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/utils/gssd/gssd_proc.c b/utils/gssd/gssd_proc.c
index b7e2bbb..2d3dbec 100644
--- a/utils/gssd/gssd_proc.c
+++ b/utils/gssd/gssd_proc.c
@@ -467,8 +467,9 @@  process_clnt_dir(char *dir, char *pdir)
 	}
 	sprintf(clp->dirname, "%s/%s", pdir, dir);
 	if ((clp->dir_fd = open(clp->dirname, O_RDONLY)) == -1) {
-		printerr(0, "ERROR: can't open %s: %s\n",
-			 clp->dirname, strerror(errno));
+		if (errno != ENOENT)
+			printerr(0, "ERROR: can't open %s: %s\n",
+				 clp->dirname, strerror(errno));
 		goto fail_destroy_client;
 	}
 	fcntl(clp->dir_fd, F_SETSIG, DNOTIFY_SIGNAL);