direct-io.hg

changeset 12351:ac10e3047f36

[LIBFSIMAGE] Don't leak FDs or RAM when closing filesystems
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
author Tim Deegan <Tim.Deegan@xensource.com>
date Fri Nov 10 12:27:56 2006 +0000 (2006-11-10)
parents 5a4517468f4f
children 60a4af3d243f
files tools/libfsimage/common/fsimage.c tools/libfsimage/common/fsimage_grub.c
line diff
     1.1 --- a/tools/libfsimage/common/fsimage.c	Fri Nov 10 11:01:15 2006 +0000
     1.2 +++ b/tools/libfsimage/common/fsimage.c	Fri Nov 10 12:27:56 2006 +0000
     1.3 @@ -72,6 +72,8 @@ fail:
     1.4  void fsi_close_fsimage(fsi_t *fsi)
     1.5  {
     1.6  	pthread_mutex_lock(&fsi_lock);
     1.7 +        fsi->f_plugin->fp_ops->fpo_umount(fsi);
     1.8 +        (void) close(fsi->f_fd);
     1.9  	fsip_fs_free(fsi);
    1.10  	pthread_mutex_unlock(&fsi_lock);
    1.11  }
     2.1 --- a/tools/libfsimage/common/fsimage_grub.c	Fri Nov 10 11:01:15 2006 +0000
     2.2 +++ b/tools/libfsimage/common/fsimage_grub.c	Fri Nov 10 12:27:56 2006 +0000
     2.3 @@ -193,7 +193,6 @@ fsig_mount(fsi_t *fsi, const char *path)
     2.4  static int
     2.5  fsig_umount(fsi_t *fsi)
     2.6  {
     2.7 -	fsip_fs_free(fsi);
     2.8  	return (0);
     2.9  }
    2.10