All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] idmapd: rearm event handler after error in nfsdcb()
@ 2009-09-10 19:42 Jeff Layton
  2009-09-10 20:28 ` J. Bruce Fields
  2009-09-14 18:07 ` [PATCH] idmapd: rearm event handler after error in nfsdcb() Steve Dickson
  0 siblings, 2 replies; 7+ messages in thread
From: Jeff Layton @ 2009-09-10 19:42 UTC (permalink / raw)
  To: linux-nfs, nfsv4

A couple of years ago, Bruce committed a patch to make knfsd send
unsigned uid's and gid's to idmapd, rather than signed values. Part
of that earlier discussion is here:

http://linux-nfs.org/pipermail/nfsv4/2007-December/007321.html

While this fixed the immediate problem, it doesn't appear that anything
was ever done to make idmapd continue working when it gets a bogus
upcall.

idmapd uses libevent for its main event handling loop. When idmapd gets
an upcall from knfsd it will service the request and then rearm the
event by calling event_add on the event structure again.

When it hits an error though, it returns in most cases w/o rearming the
event. That prevents idmapd from servicing any further requests from
knfsd.

I've made another change too. If an error is encountered while reading
the channel file, this patch has it close and reopen the file prior to
rearming the event.

I've not been able to test this patch directly, but I have tested a
backport of it to earlier idmapd code and verified that it did prevent
idmapd from hanging when it got a badly formatted upcall from knfsd.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
 utils/idmapd/idmapd.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c
index 65a6a2a..573abaa 100644
--- a/utils/idmapd/idmapd.c
+++ b/utils/idmapd/idmapd.c
@@ -139,6 +139,7 @@ static void nametoidres(struct idmap_msg *);
 
 static int nfsdopen(void);
 static int nfsdopenone(struct idmap_client *);
+static void nfsdreopen_one(struct idmap_client *);
 static void nfsdreopen(void);
 
 size_t  strlcat(char *, const char *, size_t);
@@ -502,7 +503,8 @@ nfsdcb(int fd, short which, void *data)
 		xlog_warn("nfsdcb: read(%s) failed: errno %d (%s)",
 			     ic->ic_path, len?errno:0, 
 			     len?strerror(errno):"End of File");
-		goto out;
+		nfsdreopen_one(ic);
+		return;
 	}
 
 	/* Get rid of newline and terminate buffer*/
@@ -514,11 +516,11 @@ nfsdcb(int fd, short which, void *data)
 	/* Authentication name -- ignored for now*/
 	if (getfield(&bp, authbuf, sizeof(authbuf)) == -1) {
 		xlog_warn("nfsdcb: bad authentication name in upcall\n");
-		return;
+		goto out;
 	}
 	if (getfield(&bp, typebuf, sizeof(typebuf)) == -1) {
 		xlog_warn("nfsdcb: bad type in upcall\n");
-		return;
+		goto out;
 	}
 	if (verbose > 0)
 		xlog_warn("nfsdcb: authbuf=%s authtype=%s",
@@ -532,26 +534,26 @@ nfsdcb(int fd, short which, void *data)
 		im.im_conv = IDMAP_CONV_NAMETOID;
 		if (getfield(&bp, im.im_name, sizeof(im.im_name)) == -1) {
 			xlog_warn("nfsdcb: bad name in upcall\n");
-			return;
+			goto out;
 		}
 		break;
 	case IC_IDNAME:
 		im.im_conv = IDMAP_CONV_IDTONAME;
 		if (getfield(&bp, buf1, sizeof(buf1)) == -1) {
 			xlog_warn("nfsdcb: bad id in upcall\n");
-			return;
+			goto out;
 		}
 		tmp = strtoul(buf1, (char **)NULL, 10);
 		im.im_id = (u_int32_t)tmp;
 		if ((tmp == ULONG_MAX && errno == ERANGE)
 				|| (unsigned long)im.im_id != tmp) {
 			xlog_warn("nfsdcb: id '%s' too big!\n", buf1);
-			return;
+			goto out;
 		}
 		break;
 	default:
 		xlog_warn("nfsdcb: Unknown which type %d", ic->ic_which);
-		return;
+		goto out;
 	}
 
 	imconv(ic, &im);
@@ -612,7 +614,7 @@ nfsdcb(int fd, short which, void *data)
 		break;
 	default:
 		xlog_warn("nfsdcb: Unknown which type %d", ic->ic_which);
-		return;
+		goto out;
 	}
 
 	bsiz = sizeof(buf) - bsiz;
-- 
1.5.5.6


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] idmapd: rearm event handler after error in nfsdcb()
  2009-09-10 19:42 [PATCH] idmapd: rearm event handler after error in nfsdcb() Jeff Layton
@ 2009-09-10 20:28 ` J. Bruce Fields
  2009-09-10 21:00   ` Jeff Layton
  2009-09-14 18:07 ` [PATCH] idmapd: rearm event handler after error in nfsdcb() Steve Dickson
  1 sibling, 1 reply; 7+ messages in thread
From: J. Bruce Fields @ 2009-09-10 20:28 UTC (permalink / raw)
  To: Jeff Layton; +Cc: linux-nfs, nfsv4

On Thu, Sep 10, 2009 at 03:42:07PM -0400, Jeff Layton wrote:
> A couple of years ago, Bruce committed a patch to make knfsd send
> unsigned uid's and gid's to idmapd, rather than signed values. Part
> of that earlier discussion is here:
> 
> http://linux-nfs.org/pipermail/nfsv4/2007-December/007321.html
> 
> While this fixed the immediate problem, it doesn't appear that anything
> was ever done to make idmapd continue working when it gets a bogus
> upcall.

Thanks for following up on this!

> 
> idmapd uses libevent for its main event handling loop. When idmapd gets
> an upcall from knfsd it will service the request and then rearm the
> event by calling event_add on the event structure again.
> 
> When it hits an error though, it returns in most cases w/o rearming the
> event. That prevents idmapd from servicing any further requests from
> knfsd.
> 
> I've made another change too. If an error is encountered while reading
> the channel file, this patch has it close and reopen the file prior to
> rearming the event.
> 
> I've not been able to test this patch directly, but I have tested a
> backport of it to earlier idmapd code and verified that it did prevent
> idmapd from hanging when it got a badly formatted upcall from knfsd.
> 
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
> ---
>  utils/idmapd/idmapd.c |   18 ++++++++++--------
>  1 files changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c
> index 65a6a2a..573abaa 100644
> --- a/utils/idmapd/idmapd.c
> +++ b/utils/idmapd/idmapd.c
> @@ -139,6 +139,7 @@ static void nametoidres(struct idmap_msg *);
>  
>  static int nfsdopen(void);
>  static int nfsdopenone(struct idmap_client *);
> +static void nfsdreopen_one(struct idmap_client *);
>  static void nfsdreopen(void);
>  
>  size_t  strlcat(char *, const char *, size_t);
> @@ -502,7 +503,8 @@ nfsdcb(int fd, short which, void *data)
>  		xlog_warn("nfsdcb: read(%s) failed: errno %d (%s)",
>  			     ic->ic_path, len?errno:0, 
>  			     len?strerror(errno):"End of File");
> -		goto out;
> +		nfsdreopen_one(ic);
> +		return;

Why the "return"?  From your description above ("... close and reopen
the file prior to rearming the event"), I would have thought you'd want
the final event_add() that's done at "out".

--b.

>  	}
>  
>  	/* Get rid of newline and terminate buffer*/
> @@ -514,11 +516,11 @@ nfsdcb(int fd, short which, void *data)
>  	/* Authentication name -- ignored for now*/
>  	if (getfield(&bp, authbuf, sizeof(authbuf)) == -1) {
>  		xlog_warn("nfsdcb: bad authentication name in upcall\n");
> -		return;
> +		goto out;
>  	}
>  	if (getfield(&bp, typebuf, sizeof(typebuf)) == -1) {
>  		xlog_warn("nfsdcb: bad type in upcall\n");
> -		return;
> +		goto out;
>  	}
>  	if (verbose > 0)
>  		xlog_warn("nfsdcb: authbuf=%s authtype=%s",
> @@ -532,26 +534,26 @@ nfsdcb(int fd, short which, void *data)
>  		im.im_conv = IDMAP_CONV_NAMETOID;
>  		if (getfield(&bp, im.im_name, sizeof(im.im_name)) == -1) {
>  			xlog_warn("nfsdcb: bad name in upcall\n");
> -			return;
> +			goto out;
>  		}
>  		break;
>  	case IC_IDNAME:
>  		im.im_conv = IDMAP_CONV_IDTONAME;
>  		if (getfield(&bp, buf1, sizeof(buf1)) == -1) {
>  			xlog_warn("nfsdcb: bad id in upcall\n");
> -			return;
> +			goto out;
>  		}
>  		tmp = strtoul(buf1, (char **)NULL, 10);
>  		im.im_id = (u_int32_t)tmp;
>  		if ((tmp == ULONG_MAX && errno == ERANGE)
>  				|| (unsigned long)im.im_id != tmp) {
>  			xlog_warn("nfsdcb: id '%s' too big!\n", buf1);
> -			return;
> +			goto out;
>  		}
>  		break;
>  	default:
>  		xlog_warn("nfsdcb: Unknown which type %d", ic->ic_which);
> -		return;
> +		goto out;
>  	}
>  
>  	imconv(ic, &im);
> @@ -612,7 +614,7 @@ nfsdcb(int fd, short which, void *data)
>  		break;
>  	default:
>  		xlog_warn("nfsdcb: Unknown which type %d", ic->ic_which);
> -		return;
> +		goto out;
>  	}
>  
>  	bsiz = sizeof(buf) - bsiz;
> -- 
> 1.5.5.6
> 
> _______________________________________________
> NFSv4 mailing list
> NFSv4@linux-nfs.org
> http://linux-nfs.org/cgi-bin/mailman/listinfo/nfsv4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] idmapd: rearm event handler after error in nfsdcb()
  2009-09-10 20:28 ` J. Bruce Fields
@ 2009-09-10 21:00   ` Jeff Layton
       [not found]     ` <20090910170024.2853a48e-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Jeff Layton @ 2009-09-10 21:00 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: linux-nfs, nfsv4

On Thu, 10 Sep 2009 16:28:25 -0400
"J. Bruce Fields" <bfields@fieldses.org> wrote:

> On Thu, Sep 10, 2009 at 03:42:07PM -0400, Jeff Layton wrote:
> > A couple of years ago, Bruce committed a patch to make knfsd send
> > unsigned uid's and gid's to idmapd, rather than signed values. Part
> > of that earlier discussion is here:
> > 
> > http://linux-nfs.org/pipermail/nfsv4/2007-December/007321.html
> > 
> > While this fixed the immediate problem, it doesn't appear that anything
> > was ever done to make idmapd continue working when it gets a bogus
> > upcall.
> 
> Thanks for following up on this!
> 
> > 
> > idmapd uses libevent for its main event handling loop. When idmapd gets
> > an upcall from knfsd it will service the request and then rearm the
> > event by calling event_add on the event structure again.
> > 
> > When it hits an error though, it returns in most cases w/o rearming the
> > event. That prevents idmapd from servicing any further requests from
> > knfsd.
> > 
> > I've made another change too. If an error is encountered while reading
> > the channel file, this patch has it close and reopen the file prior to
> > rearming the event.
> > 
> > I've not been able to test this patch directly, but I have tested a
> > backport of it to earlier idmapd code and verified that it did prevent
> > idmapd from hanging when it got a badly formatted upcall from knfsd.
> > 
> > Signed-off-by: Jeff Layton <jlayton@redhat.com>
> > ---
> >  utils/idmapd/idmapd.c |   18 ++++++++++--------
> >  1 files changed, 10 insertions(+), 8 deletions(-)
> > 
> > diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c
> > index 65a6a2a..573abaa 100644
> > --- a/utils/idmapd/idmapd.c
> > +++ b/utils/idmapd/idmapd.c
> > @@ -139,6 +139,7 @@ static void nametoidres(struct idmap_msg *);
> >  
> >  static int nfsdopen(void);
> >  static int nfsdopenone(struct idmap_client *);
> > +static void nfsdreopen_one(struct idmap_client *);
> >  static void nfsdreopen(void);
> >  
> >  size_t  strlcat(char *, const char *, size_t);
> > @@ -502,7 +503,8 @@ nfsdcb(int fd, short which, void *data)
> >  		xlog_warn("nfsdcb: read(%s) failed: errno %d (%s)",
> >  			     ic->ic_path, len?errno:0, 
> >  			     len?strerror(errno):"End of File");
> > -		goto out;
> > +		nfsdreopen_one(ic);
> > +		return;
> 
> Why the "return"?  From your description above ("... close and reopen
> the file prior to rearming the event"), I would have thought you'd want
> the final event_add() that's done at "out".
> 
> --b.
> 

Ahh yeah...it's not very clear from the patch, but nfsdreopen_one()
rearms the event after reopening the file. Doing a return there should
be correct.

> >  	}
> >  
> >  	/* Get rid of newline and terminate buffer*/
> > @@ -514,11 +516,11 @@ nfsdcb(int fd, short which, void *data)
> >  	/* Authentication name -- ignored for now*/
> >  	if (getfield(&bp, authbuf, sizeof(authbuf)) == -1) {
> >  		xlog_warn("nfsdcb: bad authentication name in upcall\n");
> > -		return;
> > +		goto out;
> >  	}
> >  	if (getfield(&bp, typebuf, sizeof(typebuf)) == -1) {
> >  		xlog_warn("nfsdcb: bad type in upcall\n");
> > -		return;
> > +		goto out;
> >  	}
> >  	if (verbose > 0)
> >  		xlog_warn("nfsdcb: authbuf=%s authtype=%s",
> > @@ -532,26 +534,26 @@ nfsdcb(int fd, short which, void *data)
> >  		im.im_conv = IDMAP_CONV_NAMETOID;
> >  		if (getfield(&bp, im.im_name, sizeof(im.im_name)) == -1) {
> >  			xlog_warn("nfsdcb: bad name in upcall\n");
> > -			return;
> > +			goto out;
> >  		}
> >  		break;
> >  	case IC_IDNAME:
> >  		im.im_conv = IDMAP_CONV_IDTONAME;
> >  		if (getfield(&bp, buf1, sizeof(buf1)) == -1) {
> >  			xlog_warn("nfsdcb: bad id in upcall\n");
> > -			return;
> > +			goto out;
> >  		}
> >  		tmp = strtoul(buf1, (char **)NULL, 10);
> >  		im.im_id = (u_int32_t)tmp;
> >  		if ((tmp == ULONG_MAX && errno == ERANGE)
> >  				|| (unsigned long)im.im_id != tmp) {
> >  			xlog_warn("nfsdcb: id '%s' too big!\n", buf1);
> > -			return;
> > +			goto out;
> >  		}
> >  		break;
> >  	default:
> >  		xlog_warn("nfsdcb: Unknown which type %d", ic->ic_which);
> > -		return;
> > +		goto out;
> >  	}
> >  
> >  	imconv(ic, &im);
> > @@ -612,7 +614,7 @@ nfsdcb(int fd, short which, void *data)
> >  		break;
> >  	default:
> >  		xlog_warn("nfsdcb: Unknown which type %d", ic->ic_which);
> > -		return;
> > +		goto out;
> >  	}
> >  
> >  	bsiz = sizeof(buf) - bsiz;
> > -- 
> > 1.5.5.6
> > 
> > _______________________________________________
> > NFSv4 mailing list
> > NFSv4@linux-nfs.org
> > http://linux-nfs.org/cgi-bin/mailman/listinfo/nfsv4


-- 
Jeff Layton <jlayton@redhat.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] idmapd: rearm event handler after error in nfsdcb()
       [not found]     ` <20090910170024.2853a48e-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
@ 2009-09-11 15:39       ` J. Bruce Fields
  2009-09-23 10:44         ` a question abount idmapd‏ hongpo gao
  0 siblings, 1 reply; 7+ messages in thread
From: J. Bruce Fields @ 2009-09-11 15:39 UTC (permalink / raw)
  To: Jeff Layton; +Cc: linux-nfs, nfsv4

On Thu, Sep 10, 2009 at 05:00:24PM -0400, Jeff Layton wrote:
> On Thu, 10 Sep 2009 16:28:25 -0400
> "J. Bruce Fields" <bfields@fieldses.org> wrote:
> 
> > On Thu, Sep 10, 2009 at 03:42:07PM -0400, Jeff Layton wrote:
> > > A couple of years ago, Bruce committed a patch to make knfsd send
> > > unsigned uid's and gid's to idmapd, rather than signed values. Part
> > > of that earlier discussion is here:
> > > 
> > > http://linux-nfs.org/pipermail/nfsv4/2007-December/007321.html
> > > 
> > > While this fixed the immediate problem, it doesn't appear that anything
> > > was ever done to make idmapd continue working when it gets a bogus
> > > upcall.
> > 
> > Thanks for following up on this!
> > 
> > > 
> > > idmapd uses libevent for its main event handling loop. When idmapd gets
> > > an upcall from knfsd it will service the request and then rearm the
> > > event by calling event_add on the event structure again.
> > > 
> > > When it hits an error though, it returns in most cases w/o rearming the
> > > event. That prevents idmapd from servicing any further requests from
> > > knfsd.
> > > 
> > > I've made another change too. If an error is encountered while reading
> > > the channel file, this patch has it close and reopen the file prior to
> > > rearming the event.
> > > 
> > > I've not been able to test this patch directly, but I have tested a
> > > backport of it to earlier idmapd code and verified that it did prevent
> > > idmapd from hanging when it got a badly formatted upcall from knfsd.
> > > 
> > > Signed-off-by: Jeff Layton <jlayton@redhat.com>
> > > ---
> > >  utils/idmapd/idmapd.c |   18 ++++++++++--------
> > >  1 files changed, 10 insertions(+), 8 deletions(-)
> > > 
> > > diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c
> > > index 65a6a2a..573abaa 100644
> > > --- a/utils/idmapd/idmapd.c
> > > +++ b/utils/idmapd/idmapd.c
> > > @@ -139,6 +139,7 @@ static void nametoidres(struct idmap_msg *);
> > >  
> > >  static int nfsdopen(void);
> > >  static int nfsdopenone(struct idmap_client *);
> > > +static void nfsdreopen_one(struct idmap_client *);
> > >  static void nfsdreopen(void);
> > >  
> > >  size_t  strlcat(char *, const char *, size_t);
> > > @@ -502,7 +503,8 @@ nfsdcb(int fd, short which, void *data)
> > >  		xlog_warn("nfsdcb: read(%s) failed: errno %d (%s)",
> > >  			     ic->ic_path, len?errno:0, 
> > >  			     len?strerror(errno):"End of File");
> > > -		goto out;
> > > +		nfsdreopen_one(ic);
> > > +		return;
> > 
> > Why the "return"?  From your description above ("... close and reopen
> > the file prior to rearming the event"), I would have thought you'd want
> > the final event_add() that's done at "out".
> > 
> > --b.
> > 
> 
> Ahh yeah...it's not very clear from the patch, but nfsdreopen_one()
> rearms the event after reopening the file. Doing a return there should
> be correct.

OK, got it!  Patch looks good to me.

--b.

> 
> > >  	}
> > >  
> > >  	/* Get rid of newline and terminate buffer*/
> > > @@ -514,11 +516,11 @@ nfsdcb(int fd, short which, void *data)
> > >  	/* Authentication name -- ignored for now*/
> > >  	if (getfield(&bp, authbuf, sizeof(authbuf)) == -1) {
> > >  		xlog_warn("nfsdcb: bad authentication name in upcall\n");
> > > -		return;
> > > +		goto out;
> > >  	}
> > >  	if (getfield(&bp, typebuf, sizeof(typebuf)) == -1) {
> > >  		xlog_warn("nfsdcb: bad type in upcall\n");
> > > -		return;
> > > +		goto out;
> > >  	}
> > >  	if (verbose > 0)
> > >  		xlog_warn("nfsdcb: authbuf=%s authtype=%s",
> > > @@ -532,26 +534,26 @@ nfsdcb(int fd, short which, void *data)
> > >  		im.im_conv = IDMAP_CONV_NAMETOID;
> > >  		if (getfield(&bp, im.im_name, sizeof(im.im_name)) == -1) {
> > >  			xlog_warn("nfsdcb: bad name in upcall\n");
> > > -			return;
> > > +			goto out;
> > >  		}
> > >  		break;
> > >  	case IC_IDNAME:
> > >  		im.im_conv = IDMAP_CONV_IDTONAME;
> > >  		if (getfield(&bp, buf1, sizeof(buf1)) == -1) {
> > >  			xlog_warn("nfsdcb: bad id in upcall\n");
> > > -			return;
> > > +			goto out;
> > >  		}
> > >  		tmp = strtoul(buf1, (char **)NULL, 10);
> > >  		im.im_id = (u_int32_t)tmp;
> > >  		if ((tmp == ULONG_MAX && errno == ERANGE)
> > >  				|| (unsigned long)im.im_id != tmp) {
> > >  			xlog_warn("nfsdcb: id '%s' too big!\n", buf1);
> > > -			return;
> > > +			goto out;
> > >  		}
> > >  		break;
> > >  	default:
> > >  		xlog_warn("nfsdcb: Unknown which type %d", ic->ic_which);
> > > -		return;
> > > +		goto out;
> > >  	}
> > >  
> > >  	imconv(ic, &im);
> > > @@ -612,7 +614,7 @@ nfsdcb(int fd, short which, void *data)
> > >  		break;
> > >  	default:
> > >  		xlog_warn("nfsdcb: Unknown which type %d", ic->ic_which);
> > > -		return;
> > > +		goto out;
> > >  	}
> > >  
> > >  	bsiz = sizeof(buf) - bsiz;
> > > -- 
> > > 1.5.5.6
> > > 
> > > _______________________________________________
> > > NFSv4 mailing list
> > > NFSv4@linux-nfs.org
> > > http://linux-nfs.org/cgi-bin/mailman/listinfo/nfsv4
> 
> 
> -- 
> Jeff Layton <jlayton@redhat.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] idmapd: rearm event handler after error in nfsdcb()
  2009-09-10 19:42 [PATCH] idmapd: rearm event handler after error in nfsdcb() Jeff Layton
  2009-09-10 20:28 ` J. Bruce Fields
@ 2009-09-14 18:07 ` Steve Dickson
  1 sibling, 0 replies; 7+ messages in thread
From: Steve Dickson @ 2009-09-14 18:07 UTC (permalink / raw)
  To: Jeff Layton; +Cc: linux-nfs, nfsv4



On 09/10/2009 03:42 PM, Jeff Layton wrote:
> A couple of years ago, Bruce committed a patch to make knfsd send
> unsigned uid's and gid's to idmapd, rather than signed values. Part
> of that earlier discussion is here:
> 
> http://linux-nfs.org/pipermail/nfsv4/2007-December/007321.html
> 
> While this fixed the immediate problem, it doesn't appear that anything
> was ever done to make idmapd continue working when it gets a bogus
> upcall.
> 
> idmapd uses libevent for its main event handling loop. When idmapd gets
> an upcall from knfsd it will service the request and then rearm the
> event by calling event_add on the event structure again.
> 
> When it hits an error though, it returns in most cases w/o rearming the
> event. That prevents idmapd from servicing any further requests from
> knfsd.
> 
> I've made another change too. If an error is encountered while reading
> the channel file, this patch has it close and reopen the file prior to
> rearming the event.
> 
> I've not been able to test this patch directly, but I have tested a
> backport of it to earlier idmapd code and verified that it did prevent
> idmapd from hanging when it got a badly formatted upcall from knfsd.
> 
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
Committed...

steved.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* a question abount idmapd‏
  2009-09-11 15:39       ` J. Bruce Fields
@ 2009-09-23 10:44         ` hongpo gao
       [not found]           ` <COL101-W29D4B28A8FCF99B81BCAE6A6DB0-MsuGFMq8XAE@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: hongpo gao @ 2009-09-23 10:44 UTC (permalink / raw)
  To: linux-nfs, nfsv4

[-- Attachment #1: Type: text/plain, Size: 56 bytes --]

 <20090911153904.GG2095@fieldses.org>
MIME-Version: 1.0

[-- Attachment #2.1: Type: text/plain, Size: 56 bytes --]

 <20090911153904.GG2095@fieldses.org>
MIME-Version: 1.0

[-- Attachment #2.2: Type: text/plain, Size: 1009 bytes --]



hello, 

I have a question about idmap. Should I send the mail to linux-nfs@vger.kernel.org?
The question is as follows:

In Linux Kernel fs/nfs/idmap.c, 
The
process will call rpc_queue_upcall in the nfs_idmap_id function, then
it will wait on the waitqueue util the userspace write msg into the
idmap rpc_pipe. 

In userspace idmapd.c file,
the nfscb will read the rpc_pipe by aiomicio(read, ...), write the rpc_pipe by atomicio(write,...) in the end.
my
question is : if the rpc.idmapd deamon is killed in the duration time
that between atomicio(read,.. ) and atomic(write,...), will the kernel
thread will always sleep on the wait_queue? That is to say, will the
rpc_queue_upcall be never return ?


thanks, 
Best Regards,
 		 	   		  
_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us

[-- Attachment #2.3: Type: text/html, Size: 1217 bytes --]

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
NFSv4 mailing list
NFSv4@linux-nfs.org
http://linux-nfs.org/cgi-bin/mailman/listinfo/nfsv4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: a question abount idmapd‏
       [not found]           ` <COL101-W29D4B28A8FCF99B81BCAE6A6DB0-MsuGFMq8XAE@public.gmane.org>
@ 2009-09-23 12:47             ` Trond Myklebust
  0 siblings, 0 replies; 7+ messages in thread
From: Trond Myklebust @ 2009-09-23 12:47 UTC (permalink / raw)
  To: hongpo gao; +Cc: linux-nfs, nfsv4

On Wed, 2009-09-23 at 18:44 +0800, hongpo gao wrote:
> 
> hello, 
> 
> I have a question about idmap. Should I send the mail to
> linux-nfs@vger.kernel.org?

The linux-nfs mailing list is preferred over nfsv4@linux-nfs.org, if
that's what you mean.

> The question is as follows:
> 
> In Linux Kernel fs/nfs/idmap.c, 
> The process will call rpc_queue_upcall in the nfs_idmap_id function,
> then it will wait on the waitqueue util the userspace write msg into
> the idmap rpc_pipe. 
> 
> In userspace idmapd.c file,
> the nfscb will read the rpc_pipe by aiomicio(read, ...), write the
> rpc_pipe by atomicio(write,...) in the end.
> my question is : if the rpc.idmapd deamon is killed in the duration
> time that between atomicio(read,.. ) and atomic(write,...), will the
> kernel thread will always sleep on the wait_queue? That is to say,
> will the rpc_queue_upcall be never return ?

No. The kernel tracks whether or not a daemon is listening on the other
end of the rpc_pipe, and will therefore return an error should the above
scenario happen.

Cheers
  Trond


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-09-23 12:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-10 19:42 [PATCH] idmapd: rearm event handler after error in nfsdcb() Jeff Layton
2009-09-10 20:28 ` J. Bruce Fields
2009-09-10 21:00   ` Jeff Layton
     [not found]     ` <20090910170024.2853a48e-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2009-09-11 15:39       ` J. Bruce Fields
2009-09-23 10:44         ` a question abount idmapd‏ hongpo gao
     [not found]           ` <COL101-W29D4B28A8FCF99B81BCAE6A6DB0-MsuGFMq8XAE@public.gmane.org>
2009-09-23 12:47             ` Trond Myklebust
2009-09-14 18:07 ` [PATCH] idmapd: rearm event handler after error in nfsdcb() Steve Dickson

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.