From owner-freebsd-fs@FreeBSD.ORG Tue Jan 15 00:51:00 2013 Return-Path: Delivered-To: fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 233E5EAA; Tue, 15 Jan 2013 00:51:00 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id 9861E8BC; Tue, 15 Jan 2013 00:50:59 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqAEACSn9FCDaFvO/2dsb2JhbABEhjq3WHOCHgEBAQQBAQEgKyALGw4KAgINGQIpAQkmBggHBAEcBId4DKUikFqBI4tjgxWBEwOIYYp8gi6BHI8tgxOBUTU X-IronPort-AV: E=Sophos;i="4.84,469,1355115600"; d="scan'208";a="11900158" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-jnhn.mail.uoguelph.ca with ESMTP; 14 Jan 2013 19:50:52 -0500 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 9DBE8B3F16; Mon, 14 Jan 2013 19:50:52 -0500 (EST) Date: Mon, 14 Jan 2013 19:50:52 -0500 (EST) From: Rick Macklem To: John Baldwin Message-ID: <21875538.1984621.1358211052621.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <201301141437.05040.jhb@freebsd.org> Subject: Re: [PATCH] Properly handle signals on interruptible NFS mounts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.203] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - FF3.0 (Win)/6.0.10_GA_2692) Cc: Rick Macklem , Doug Rabson , fs@freebsd.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jan 2013 00:51:00 -0000 John Baldwin wrote: > When the new RPC layer was brought in, the RPC_INTR return value (to > indicate > an RPC request was interrupted by a signal) was not handled in the NFS > client. > As a result, if an NFS request is interrupted by a signal (on a mount > with the > "intr" option), then the nfs_request() functions would fall through to > the > default case and return EACCES rather than EINTR. While here, I > noticed that > the new RPC layer also lost all of the RPC statistics the old client > used to > keep (but that are still reported in 'nfsstat -c'). I've added back as > many > of the statistics as I could, but retries are not easy to do as only > the RPC > layer knows about them and not the NFS client. > > Index: fs/nfs/nfs_commonkrpc.c > =================================================================== > --- fs/nfs/nfs_commonkrpc.c (revision 245225) > +++ fs/nfs/nfs_commonkrpc.c (working copy) > @@ -767,12 +767,18 @@ > if (stat == RPC_SUCCESS) { > error = 0; > } else if (stat == RPC_TIMEDOUT) { > + NFSINCRGLOBAL(newnfsstats.rpctimeouts); > error = ETIMEDOUT; > } else if (stat == RPC_VERSMISMATCH) { > + NFSINCRGLOBAL(newnfsstats.rpcinvalid); > error = EOPNOTSUPP; > } else if (stat == RPC_PROGVERSMISMATCH) { > + NFSINCRGLOBAL(newnfsstats.rpcinvalid); > error = EPROTONOSUPPORT; > + } else if (stat == RPC_INTR) { > + error = EINTR; > } else { > + NFSINCRGLOBAL(newnfsstats.rpcinvalid); > error = EACCES; > } > if (error) { > Index: nfsclient/nfs_krpc.c > =================================================================== > --- nfsclient/nfs_krpc.c (revision 245225) > +++ nfsclient/nfs_krpc.c (working copy) > @@ -549,14 +549,21 @@ > */ > if (stat == RPC_SUCCESS) > error = 0; > - else if (stat == RPC_TIMEDOUT) > + else if (stat == RPC_TIMEDOUT) { > + nfsstats.rpctimeouts++; > error = ETIMEDOUT; > - else if (stat == RPC_VERSMISMATCH) > + } else if (stat == RPC_VERSMISMATCH) { > + nfsstats.rpcinvalid++; > error = EOPNOTSUPP; > - else if (stat == RPC_PROGVERSMISMATCH) > + } else if (stat == RPC_PROGVERSMISMATCH) { > + nfsstats.rpcinvalid++; > error = EPROTONOSUPPORT; > - else > + } else if (stat == RPC_INTR) { > + error = EINTR; > + } else { > + nfsstats.rpcinvalid++; > error = EACCES; > + } > if (error) > goto nfsmout; > > @@ -572,6 +579,7 @@ > if (error == ENOMEM) { > m_freem(mrep); > AUTH_DESTROY(auth); > + nfsstats.rpcinvalid++; > return (error); > } > This patch looks fine to me, rick > > -- > John Baldwin > _______________________________________________ > freebsd-fs@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org"