From patchwork Mon Aug 12 16:41:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Bruce Fields" X-Patchwork-Id: 2843114 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 09FD9BF546 for ; Mon, 12 Aug 2013 16:41:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3437F204E4 for ; Mon, 12 Aug 2013 16:41:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0CE14204E2 for ; Mon, 12 Aug 2013 16:41:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756865Ab3HLQlr (ORCPT ); Mon, 12 Aug 2013 12:41:47 -0400 Received: from fieldses.org ([174.143.236.118]:46570 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756357Ab3HLQlr (ORCPT ); Mon, 12 Aug 2013 12:41:47 -0400 Received: from bfields by fieldses.org with local (Exim 4.76) (envelope-from ) id 1V8vBg-0000wZ-QS; Mon, 12 Aug 2013 12:41:44 -0400 Date: Mon, 12 Aug 2013 12:41:44 -0400 To: steved@redhat.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH] idmapd: silence pointless EOF warning Message-ID: <20130812164144.GC2395@fieldses.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) From: "J. Bruce Fields" Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "J. Bruce Fields" 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 --- utils/idmapd/idmapd.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c index beba9c4..cc4ba9a 100644 --- a/utils/idmapd/idmapd.c +++ b/utils/idmapd/idmapd.c @@ -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; }