mount.nfs: mount's background daemon should free "mount_point" properly
Subsystems (2)
PATCH 1/4 mount.nfs: mount's background daemon should free "mount_point" properly
---
utils/mount/mount.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
utils/mount/mount.c +2 -1
@@ -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 - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
utils/mount/mount.c int main(int argc, char *argv[]) · line 560
Quoted 3 lines · Chuck Lever
utils/mount/mount.c +1
-1* Parent exits immediately with success. Make -* sure not to free "mount_point" +* sure parent doesn't free "mount_point".
What made this change?
/* Steinar */
Signature · 10 lines
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 - [email protected] https://lists.sourceforge.net/lists/listinfo/nfs
Quoted 6 lines · Steinar H. Gunderson
utils/mount/mount.c int main(int argc, char *argv[]) · line 560
Quoted 3 lines · Chuck Lever
utils/mount/mount.c +1
-1* 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.
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
-------------------------------------------------------------------------
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 - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
Quoted 11 lines · On Tuesday August 21, [email protected] wrote:
Signed-off-by Chuck Lever <[email protected]>---
utils/mount/mount.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)utils/mount/mount.c +0
-0
utils/mount/mount.c int main(int argc, char *argv[]) · line 561
Quoted 6 lines
utils/mount/mount.c +1
-1@@ -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.
utils/mount/mount.c int main(int argc, char *argv[]) · line 574
Quoted 10 lines
utils/mount/mount.c +1
-0if (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 - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs