Linux NFS development
 help / color / mirror / Atom feed
* [PATCH 1/4] mount.nfs: mount's background daemon should free "mount_point" properly
@ 2007-08-21 16:19 Chuck Lever
  2007-08-21 22:19 ` Steinar H. Gunderson
  2007-08-24  3:11 ` Neil Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Chuck Lever @ 2007-08-21 16:19 UTC (permalink / raw)
  To: neilb; +Cc: nfs

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---

 utils/mount/mount.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/utils/mount/mount.c b/utils/mount/mount.c
index d299358..40e7958 100644
--- a/utils/mount/mount.c
+++ b/utils/mount/mount.c
@@ -557,7 +557,7 @@ int main(int argc, char *argv[])
 
 		/*
 		 * Parent exits immediately with success.  Make
-		 * sure not to free "mount_point"
+		 * sure parent doesn't free "mount_point".
 		 */
 		if (fork() > 0)
 			exit(0);
@@ -568,6 +568,7 @@ int main(int argc, char *argv[])
 		if (verbose && mnt_err)
 			printf(_("%s: giving up \"%s\"\n"),
 				progname, spec);
+		free(mount_point);
 		exit(0);
 	}
 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

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

* Re: [PATCH 1/4] mount.nfs: mount's background daemon should free "mount_point" properly
  2007-08-21 16:19 [PATCH 1/4] mount.nfs: mount's background daemon should free "mount_point" properly Chuck Lever
@ 2007-08-21 22:19 ` Steinar H. Gunderson
  2007-08-22  5:10   ` Chuck Lever
  2007-08-24  3:11 ` Neil Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Steinar H. Gunderson @ 2007-08-21 22:19 UTC (permalink / raw)
  To: nfs

On Tue, Aug 21, 2007 at 12:19:02PM -0400, Chuck Lever wrote:
>  		 * Parent exits immediately with success.  Make
> -		 * sure not to free "mount_point"
> +		 * sure parent doesn't free "mount_point".

What made this change?

/* Steinar */
-- 
Homepage: http://www.sesse.net/

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

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

* Re: [PATCH 1/4] mount.nfs: mount's background daemon should free "mount_point" properly
  2007-08-21 22:19 ` Steinar H. Gunderson
@ 2007-08-22  5:10   ` Chuck Lever
  0 siblings, 0 replies; 4+ messages in thread
From: Chuck Lever @ 2007-08-22  5:10 UTC (permalink / raw)
  To: Steinar H. Gunderson; +Cc: nfs

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

Steinar H. Gunderson wrote:
> On Tue, Aug 21, 2007 at 12:19:02PM -0400, Chuck Lever wrote:
>>  		 * Parent exits immediately with success.  Make
>> -		 * sure not to free "mount_point"
>> +		 * sure parent doesn't free "mount_point".
> 
> What made this change?

Nothing, I'm clarifying my original comment here.  I just didn't have 
time to test the additional free() before I submitted the first bg patches.

Before any of this was added, there was no free'ing of mount_point at 
all -- mount.nfs left exit() processing to free everything.

[-- Attachment #2: chuck.lever.vcf --]
[-- Type: text/x-vcard, Size: 290 bytes --]

begin:vcard
fn:Chuck Lever
n:Lever;Chuck
org:Oracle Corporation;Corporate Architecture: Linux Projects Group
adr:;;1015 Granger Avenue;Ann Arbor;MI;48104;USA
title:Principal Member of Staff
tel;work:+1 248 614 5091
x-mozilla-html:FALSE
url:http://oss.oracle.com/~cel
version:2.1
end:vcard


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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

[-- Attachment #4: Type: text/plain, Size: 140 bytes --]

_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

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

* Re: [PATCH 1/4] mount.nfs: mount's background daemon should free "mount_point" properly
  2007-08-21 16:19 [PATCH 1/4] mount.nfs: mount's background daemon should free "mount_point" properly Chuck Lever
  2007-08-21 22:19 ` Steinar H. Gunderson
@ 2007-08-24  3:11 ` Neil Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Neil Brown @ 2007-08-24  3:11 UTC (permalink / raw)
  To: Chuck Lever; +Cc: nfs

On Tuesday August 21, chuck.lever@oracle.com wrote:
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
> 
>  utils/mount/mount.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/utils/mount/mount.c b/utils/mount/mount.c
> index d299358..40e7958 100644
> --- a/utils/mount/mount.c
> +++ b/utils/mount/mount.c
> @@ -557,7 +557,7 @@ int main(int argc, char *argv[])
>  
>  		/*
>  		 * Parent exits immediately with success.  Make
> -		 * sure not to free "mount_point"
> +		 * sure parent doesn't free "mount_point".
>  		 */

I certainly agree that this comment could be improved.   I don't think
your change improves it.  I think I'll just remove the second sentence.

>  		if (fork() > 0)
>  			exit(0);
> @@ -568,6 +568,7 @@ int main(int argc, char *argv[])
>  		if (verbose && mnt_err)
>  			printf(_("%s: giving up \"%s\"\n"),
>  				progname, spec);
> +		free(mount_point);
>  		exit(0);
>  	}
>  

Calling 'free' before 'exit' seems like an exercise in
futility.. unless you want to remove warnings from 'valgrind' or
something like that...
How about I just remove the 'exit(0)', and it will fall through and
free(mount_point) and then exit (with a status that will be ignored)?

NeilBrown

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

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

end of thread, other threads:[~2007-08-24  3:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-21 16:19 [PATCH 1/4] mount.nfs: mount's background daemon should free "mount_point" properly Chuck Lever
2007-08-21 22:19 ` Steinar H. Gunderson
2007-08-22  5:10   ` Chuck Lever
2007-08-24  3:11 ` Neil Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox