diff mbox series

gssd: ignore pipe files that do not exist

Message ID 20200308192214.25071-1-steved@redhat.com (mailing list archive)
State New, archived
Headers show
Series gssd: ignore pipe files that do not exist | expand

Commit Message

Steve Dickson March 8, 2020, 7:22 p.m. UTC
As part commit e0eb6ebb which cleaned up the
dnotify to inotify conversion (commit 55197c98)
ignore pipe files that don't exist

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 utils/gssd/gssd.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

Comments

Steve Dickson March 27, 2020, 7:15 p.m. UTC | #1
On 3/8/20 3:22 PM, Steve Dickson wrote:
> As part commit e0eb6ebb which cleaned up the
> dnotify to inotify conversion (commit 55197c98)
> ignore pipe files that don't exist
> 
> Signed-off-by: Steve Dickson <steved@redhat.com>
Committed... (tag: nfs-utils-2-4-4-rc2)

steved.
> ---
>  utils/gssd/gssd.c | 18 ++++++++++--------
>  1 file changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/utils/gssd/gssd.c b/utils/gssd/gssd.c
> index c38dedb..588da0f 100644
> --- a/utils/gssd/gssd.c
> +++ b/utils/gssd/gssd.c
> @@ -493,8 +493,8 @@ gssd_get_clnt(struct topdir *tdi, const char *name)
>  	clp->wd = inotify_add_watch(inotify_fd, clp->relpath, IN_CREATE | IN_DELETE);
>  	if (clp->wd < 0) {
>  		if (errno != ENOENT)
> -			printerr(0, "ERROR: inotify_add_watch failed for %s: %s\n",
> -			 	clp->relpath, strerror(errno));
> +			printerr(0, "ERROR: %s: inotify_add_watch failed for %s: %s\n",
> +			 	__FUNCTION__, clp->relpath, strerror(errno));
>  		goto out;
>  	}
>  
> @@ -523,8 +523,9 @@ gssd_scan_clnt(struct clnt_info *clp)
>  
>  	clntfd = openat(pipefs_fd, clp->relpath, O_RDONLY);
>  	if (clntfd < 0) {
> -		printerr(0, "ERROR: can't openat %s: %s\n",
> -			 clp->relpath, strerror(errno));
> +		if (errno != ENOENT)
> +			printerr(0, "ERROR: %s: can't openat %s: %s\n",
> +			 	__FUNCTION__, clp->relpath, strerror(errno));
>  		return -1;
>  	}
>  
> @@ -588,8 +589,8 @@ gssd_get_topdir(const char *name)
>  
>  	tdi->wd = inotify_add_watch(inotify_fd, name, IN_CREATE);
>  	if (tdi->wd < 0) {
> -		printerr(0, "ERROR: inotify_add_watch failed for top dir %s: %s\n",
> -			 tdi->name, strerror(errno));
> +		printerr(0, "ERROR: %s: inotify_add_watch failed for top dir %s: %s\n",
> +			 __FUNCTION__, tdi->name, strerror(errno));
>  		free(tdi);
>  		return NULL;
>  	}
> @@ -616,8 +617,9 @@ gssd_scan_topdir(const char *name)
>  
>  	dfd = openat(pipefs_fd, tdi->name, O_RDONLY);
>  	if (dfd < 0) {
> -		printerr(0, "ERROR: can't openat %s: %s\n",
> -			 tdi->name, strerror(errno));
> +		if (errno != ENOENT)
> +			printerr(0, "ERROR: %s: can't openat %s: %s\n",
> +			 	__FUNCTION__, tdi->name, strerror(errno));
>  		return;
>  	}
>  
>
diff mbox series

Patch

diff --git a/utils/gssd/gssd.c b/utils/gssd/gssd.c
index c38dedb..588da0f 100644
--- a/utils/gssd/gssd.c
+++ b/utils/gssd/gssd.c
@@ -493,8 +493,8 @@  gssd_get_clnt(struct topdir *tdi, const char *name)
 	clp->wd = inotify_add_watch(inotify_fd, clp->relpath, IN_CREATE | IN_DELETE);
 	if (clp->wd < 0) {
 		if (errno != ENOENT)
-			printerr(0, "ERROR: inotify_add_watch failed for %s: %s\n",
-			 	clp->relpath, strerror(errno));
+			printerr(0, "ERROR: %s: inotify_add_watch failed for %s: %s\n",
+			 	__FUNCTION__, clp->relpath, strerror(errno));
 		goto out;
 	}
 
@@ -523,8 +523,9 @@  gssd_scan_clnt(struct clnt_info *clp)
 
 	clntfd = openat(pipefs_fd, clp->relpath, O_RDONLY);
 	if (clntfd < 0) {
-		printerr(0, "ERROR: can't openat %s: %s\n",
-			 clp->relpath, strerror(errno));
+		if (errno != ENOENT)
+			printerr(0, "ERROR: %s: can't openat %s: %s\n",
+			 	__FUNCTION__, clp->relpath, strerror(errno));
 		return -1;
 	}
 
@@ -588,8 +589,8 @@  gssd_get_topdir(const char *name)
 
 	tdi->wd = inotify_add_watch(inotify_fd, name, IN_CREATE);
 	if (tdi->wd < 0) {
-		printerr(0, "ERROR: inotify_add_watch failed for top dir %s: %s\n",
-			 tdi->name, strerror(errno));
+		printerr(0, "ERROR: %s: inotify_add_watch failed for top dir %s: %s\n",
+			 __FUNCTION__, tdi->name, strerror(errno));
 		free(tdi);
 		return NULL;
 	}
@@ -616,8 +617,9 @@  gssd_scan_topdir(const char *name)
 
 	dfd = openat(pipefs_fd, tdi->name, O_RDONLY);
 	if (dfd < 0) {
-		printerr(0, "ERROR: can't openat %s: %s\n",
-			 tdi->name, strerror(errno));
+		if (errno != ENOENT)
+			printerr(0, "ERROR: %s: can't openat %s: %s\n",
+			 	__FUNCTION__, tdi->name, strerror(errno));
 		return;
 	}