From 7c8eba31b6c1888fad2481ed5e365f766ba6120d Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields" Date: Mon, 19 Aug 2013 12:55:01 -0400 Subject: 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 Signed-off-by: Steve Dickson --- utils/idmapd/idmapd.c | 12 ++++++++---- 1 file 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; } -- cgit