Skip to contentSkip to conversation

idmapd: silence pointless EOF warning

PATCH In review J. Bruce Fields 2 participants 2 messages Aug 12, 2013 – Aug 19, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 idmapd: silence pointless EOF warning

From: "J. Bruce Fields" <[email protected]>

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.

---
 utils/idmapd/idmapd.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
utils/idmapd/idmapd.c +7 -3
index beba9c4..cc4ba9a 100644
@@ -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;
 	}
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 8 lines · J. Bruce Fields

From: "J. Bruce Fields" <[email protected]>

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.

Quoted 4 lines

So just skip the warning in that case. I also can't see a reason to reopen.

Committed...

steved.

Quoted 27 lines
---
 utils/idmapd/idmapd.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
utils/idmapd/idmapd.c +7 -3
index beba9c4..cc4ba9a 100644
@@ -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;
 	}