All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Benny Halevy <bhalevy@panasas.com>,
	Olga Kornievskaia <aglo@citi.umich.edu>,
	linux-nfs@vger.kernel.org, pnfs mailing list <pnfs@linux-nfs.org>,
	Trond Myklebust <trond@netapp.com>
Subject: Re: [pnfs] [PATCH] nfsd: use nfs client rpc callback program
Date: Wed, 24 Sep 2008 13:21:34 -0400	[thread overview]
Message-ID: <20080924172134.GI5772@fieldses.org> (raw)
In-Reply-To: <1222275582.7390.8.camel@localhost>

On Wed, Sep 24, 2008 at 12:59:42PM -0400, Trond Myklebust wrote:
> On Wed, 2008-09-24 at 12:35 -0400, J. Bruce Fields wrote:
> > On Thu, Sep 18, 2008 at 02:24:39PM -0500, Benny Halevy wrote:
> > > From: Benny Halevy <bhalevy@panasas.com>
> > > 
> > > since commit ff7d9756b501744540be65e172d27ee321d86103
> > > "nfsd: use static memory for callback program and stats"
> > > do_probe_callback uses a static callback program
> > > (NFS4_CALLBACK) rather than the one set in clp->cl_callback.cb_prog
> > > as passed in by the client in setclientid (4.0)
> > > or create_session (4.1).
> > > 
> > > This patches allows allocating cb_program (and cb_stats) dynamically
> > > and setting a free_rpc_program function pointer to be
> > > called when the rpc_clnt structure is destroyed.
> > 
> > So that means we handle two cases:
> > 
> > 	- free_rpc_program = NULL: We assume the program and stats are
> > 	  in static memory (or module memory--which might be a problem
> > 	  if we shut down the server and remove the nfsd module in quick
> > 	  succession.  I assume there's a similar (probably very
> > 	  hard-to-hit) bug on the client too, but haven't looked
> > 	  carefully.).
> > 	- free_rpc_program != NULL: We assume this rpc_client is the
> > 	  last user of the program.
> > 
> > It seems a little ad hoc, but I can't see why it wouldn't solve the
> > problem.
> > 
> > I'd want Trond's ack.
> 
> Well the current implementation is certainly broken.  Look at what
> happens if I clone the rpc_clnt...

Hence the comment that "we assume this rpc_client is the last user of
the program."  I believe that assumption is correct in the case of nfsd
callbacks, so Benny's patch is at least not broken--just a little
ad-hoc.

So the question is whether the above solution, which addresses only this
particular case, is sufficient, or whether we'd like something more
general, like adding a reference count to the program along with a
free_program callback called only on the final put.

--b.

  reply	other threads:[~2008-09-24 17:21 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-17 19:43 [PATCH] nfsd: use nfs client rpc callback program Benny Halevy
2008-09-17 23:10 ` J. Bruce Fields
2008-09-17 23:34   ` Benny Halevy
2008-09-18  0:10     ` [pnfs] " Benny Halevy
2008-09-18 19:24       ` Benny Halevy
2008-09-18 19:43         ` Peter Staubach
2008-09-18 20:05           ` Benny Halevy
2008-09-18 21:36             ` Benny Halevy
2008-09-24 16:35         ` J. Bruce Fields
2008-09-24 16:59           ` Trond Myklebust
2008-09-24 17:21             ` J. Bruce Fields [this message]
2008-09-24 17:26               ` Trond Myklebust
2008-09-24 17:42                 ` J. Bruce Fields
2008-09-24 18:42                   ` Trond Myklebust
2008-09-24 18:49                     ` J. Bruce Fields
2008-09-25 19:30                       ` Benny Halevy
2008-09-25 20:00                         ` J. Bruce Fields
2008-09-25 20:27                           ` Trond Myklebust
2008-09-25 20:41                             ` J. Bruce Fields
2008-09-26 11:52                               ` Benny Halevy
2008-09-27  3:34                                 ` J. Bruce Fields
2008-09-28  6:21                                   ` [PATCH v4] " Benny Halevy
2008-09-29 19:21                                     ` J. Bruce Fields
2008-09-25 20:08                         ` [pnfs] [PATCH] " Trond Myklebust
2008-09-25 20:38                           ` J. Bruce Fields
2008-09-19 19:51     ` Olga Kornievskaia
2008-09-19 21:15       ` Benny Halevy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080924172134.GI5772@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=aglo@citi.umich.edu \
    --cc=bhalevy@panasas.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=pnfs@linux-nfs.org \
    --cc=trond.myklebust@fys.uio.no \
    --cc=trond@netapp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.