summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2013-08-19 12:55:01 -0400
committerSteve Dickson <steved@redhat.com>2013-08-19 13:04:51 -0400
commit7c8eba31b6c1888fad2481ed5e365f766ba6120d (patch)
treea058db01a216940c54a5559a8e10392caa8928f7
parent12a590f8d556c00a9502eeebaa763d906222d521 (diff)
downloadnfs-utils-7c8eba31b6c1888fad2481ed5e365f766ba6120d.tar.gz
nfs-utils-7c8eba31b6c1888fad2481ed5e365f766ba6120d.tar.xz
nfs-utils-7c8eba31b6c1888fad2481ed5e365f766ba6120d.zip
rpc.idmapd: silence pointless EOF warning
RH bz 831455 has a report that repeatedly mounting and unmounting over lo can hit this warning in the EOF case. I suspect that's just normal--I'm not sure of the details, but probably idmapd gets woken up to check for an upcall and then the upcall gets yanked away before idmapd gets a chance to read it. So just skip the warning in that case. I also can't see a reason to reopen. Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--utils/idmapd/idmapd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c
index beba9c4..b6c6231 100644
--- a/utils/idmapd/idmapd.c
+++ b/utils/idmapd/idmapd.c
@@ -502,7 +502,7 @@ nfsdcb(int UNUSED(fd), short which, void *data)
struct idmap_client *ic = data;
struct idmap_msg im;
u_char buf[IDMAP_MAXMSGSZ + 1];
- size_t len;
+ ssize_t len;
ssize_t bsiz;
char *bp, typebuf[IDMAP_MAXMSGSZ],
buf1[IDMAP_MAXMSGSZ], authbuf[IDMAP_MAXMSGSZ], *p;
@@ -511,10 +511,14 @@ nfsdcb(int UNUSED(fd), short which, void *data)
if (which != EV_READ)
goto out;
- if ((len = read(ic->ic_fd, buf, sizeof(buf))) <= 0) {
+ len = read(ic->ic_fd, buf, sizeof(buf));
+ if (len == 0)
+ /* No upcall to read; not necessarily a problem: */
+ return;
+ if (len < 0) {
xlog_warn("nfsdcb: read(%s) failed: errno %d (%s)",
- ic->ic_path, len?errno:0,
- len?strerror(errno):"End of File");
+ ic->ic_path, errno,
+ strerror(errno));
nfsdreopen_one(ic);
return;
}