From: Chuck Lever Subject: Re: [RFC,PATCH 20/35] svc: Make svc_send transport neutral Date: Tue, 2 Oct 2007 12:54:32 -0400 Message-ID: References: <20071001191426.3250.15371.stgit@dell3.ogc.int> <20071001192814.3250.76840.stgit@dell3.ogc.int> <1191343596.1565.30.camel@trinity.ogc.int> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset="us-ascii" Cc: neilb@suse.de, bfields@fieldses.org, nfs@lists.sourceforge.net, gnb@sgi.com To: tom@opengridcomputing.com Return-path: Received: from sc8-sf-mx1-b.sourceforge.net ([10.3.1.91] helo=mail.sourceforge.net) by sc8-sf-list2-new.sourceforge.net with esmtp (Exim 4.43) id 1Icl1V-0007J9-Ua for nfs@lists.sourceforge.net; Tue, 02 Oct 2007 09:55:06 -0700 Received: from agminet01.oracle.com ([141.146.126.228]) by mail.sourceforge.net with esmtps (TLSv1:AES256-SHA:256) (Exim 4.44) id 1Icl1Z-0005FX-Sc for nfs@lists.sourceforge.net; Tue, 02 Oct 2007 09:55:11 -0700 In-Reply-To: <1191343596.1565.30.camel@trinity.ogc.int> List-Id: "Discussion of NFS under Linux development, interoperability, and testing." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: nfs-bounces@lists.sourceforge.net Errors-To: nfs-bounces@lists.sourceforge.net On Oct 2, 2007, at 12:46 PM, Tom Tucker wrote: > On Tue, 2007-10-02 at 12:15 -0400, Chuck Lever wrote: >> On Oct 1, 2007, at 3:28 PM, Tom Tucker wrote: >>> > > [...snip...] > >>> - if ((svsk = rqstp->rq_sock) == NULL) { >>> - printk(KERN_WARNING "NULL socket pointer in %s:%d\n", >>> + if ((xprt = rqstp->rq_xprt) == NULL) { >>> + printk(KERN_WARNING "NULL transport pointer in %s:%d\n", >>> __FILE__, __LINE__); >>> return -EFAULT; >>> } >> >> Do we still want this printk here? Maybe it can be removed. > > I don't know why it's here. Maybe replace it with a BUG_ON? /me makes an X with his fingers and hisses like a cat.... BUG_ON is heavyweight and often makes the system unusable after a short while by leaving a lot of bogus state (like held locks). Unless a NULL here is a real sign of a software fault that requires a hard stop, simply returning EFAULT makes sense. >> >>> @@ -1674,13 +1674,13 @@ svc_send(struct svc_rqst *rqstp) >>> xb->page_len + >>> xb->tail[0].iov_len; >>> >>> - /* Grab svsk->sk_mutex to serialize outgoing data. */ >>> - mutex_lock(&svsk->sk_mutex); >>> - if (test_bit(XPT_DEAD, &svsk->sk_xprt.xpt_flags)) >>> + /* Grab mutex to serialize outgoing data. */ >>> + mutex_lock(&xprt->xpt_mutex); >>> + if (test_bit(XPT_DEAD, &xprt->xpt_flags)) >>> len = -ENOTCONN; >>> else >>> - len = svsk->sk_xprt.xpt_ops.xpo_sendto(rqstp); >>> - mutex_unlock(&svsk->sk_mutex); >>> + len = xprt->xpt_ops.xpo_sendto(rqstp); >>> + mutex_unlock(&xprt->xpt_mutex); >>> svc_sock_release(rqstp); >>> >>> if (len == -ECONNREFUSED || len == -ENOTCONN || len == -EAGAIN) >>> @@ -1782,7 +1782,6 @@ static struct svc_sock *svc_setup_socket >>> svsk->sk_lastrecv = get_seconds(); >>> spin_lock_init(&svsk->sk_lock); >>> INIT_LIST_HEAD(&svsk->sk_deferred); >>> - mutex_init(&svsk->sk_mutex); >>> >>> /* Initialize the socket */ >>> if (sock->type == SOCK_DGRAM) >> >> Chuck Lever >> chuck.lever@oracle.com >> >> > Chuck Lever chuck.lever@oracle.com ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ NFS maillist - NFS@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nfs