Explorar o código

btrfs: fix memory leak when there is no more seed device

When we replace all the seed device in the system there is
no point in just keeping the btrfs_fs_devices with out
any device

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Chris Mason <clm@fb.com>
Anand Jain %!s(int64=11) %!d(string=hai) anos
pai
achega
8bef8401a0
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      fs/btrfs/volumes.c

+ 2 - 0
fs/btrfs/volumes.c

@@ -1868,6 +1868,8 @@ void btrfs_rm_dev_replace_srcdev(struct btrfs_fs_info *fs_info,
 			tmp_fs_devices = tmp_fs_devices->seed;
 		}
 		fs_devices->seed = NULL;
+		__btrfs_close_devices(fs_devices);
+		free_fs_devices(fs_devices);
 	}
 }