diff -Nru ceph-12.2.12/debian/changelog ceph-12.2.12/debian/changelog --- ceph-12.2.12/debian/changelog 2019-08-30 11:11:09.000000000 +0200 +++ ceph-12.2.12/debian/changelog 2019-11-06 11:25:31.000000000 +0100 @@ -1,3 +1,9 @@ +ceph (12.2.12-0ubuntu0.18.04.4) bionic; urgency=medium + + * d/p/issue37490.patch: ceph-volume: reuse list of LVs (LP: #1850754). + + -- Dariusz Gadomski Wed, 06 Nov 2019 11:25:31 +0100 + ceph (12.2.12-0ubuntu0.18.04.3) bionic; urgency=medium [ James Page ] diff -Nru ceph-12.2.12/debian/patches/issue37490.patch ceph-12.2.12/debian/patches/issue37490.patch --- ceph-12.2.12/debian/patches/issue37490.patch 1970-01-01 01:00:00.000000000 +0100 +++ ceph-12.2.12/debian/patches/issue37490.patch 2019-11-06 11:25:31.000000000 +0100 @@ -0,0 +1,97 @@ +Description: ceph-volume: reuse list of LVs + Avoid creating of list of LVs in different methods of the same module + and resue them. + . + ceph (12.2.12-0ubuntu0.18.04.4) bionic; urgency=medium + . + * d/p/issue37490.patch: ceph-volume: reuse list of LVs (LP: #1850754). + +Origin: upstream, https://github.com/ceph/ceph/commit/ab3a58e78124a984d162b2f63992d01c5e59e2a7 +Bug: https://tracker.ceph.com/issues/37490 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1850754 +Last-Update: 2019-11-06 + +--- ceph-12.2.12.orig/src/ceph-volume/ceph_volume/api/lvm.py ++++ ceph-12.2.12/src/ceph-volume/ceph_volume/api/lvm.py +@@ -359,7 +359,7 @@ def get_lv_from_argument(argument): + return get_lv(lv_name=lv_name, vg_name=vg_name) + + +-def get_lv(lv_name=None, vg_name=None, lv_path=None, lv_uuid=None, lv_tags=None): ++def get_lv(lv_name=None, vg_name=None, lv_path=None, lv_uuid=None, lv_tags=None, lvs=None): + """ + Return a matching lv for the current system, requiring ``lv_name``, + ``vg_name``, ``lv_path`` or ``tags``. Raises an error if more than one lv +@@ -371,7 +371,8 @@ def get_lv(lv_name=None, vg_name=None, l + """ + if not any([lv_name, vg_name, lv_path, lv_uuid, lv_tags]): + return None +- lvs = Volumes() ++ if lvs is None: ++ lvs = Volumes() + return lvs.get( + lv_name=lv_name, vg_name=vg_name, lv_path=lv_path, lv_uuid=lv_uuid, + lv_tags=lv_tags +--- ceph-12.2.12.orig/src/ceph-volume/ceph_volume/devices/lvm/listing.py ++++ ceph-12.2.12/src/ceph-volume/ceph_volume/devices/lvm/listing.py +@@ -112,8 +112,8 @@ class List(object): + def list(self, args): + # ensure everything is up to date before calling out + # to list lv's +- self.update() +- report = self.generate(args) ++ lvs = self.update() ++ report = self.generate(args, lvs) + if args.format == 'json': + # If the report is empty, we don't return a non-zero exit status + # because it is assumed this is going to be consumed by automated +@@ -153,25 +153,27 @@ class List(object): + # this means that the device has changed, so it must be updated + # on the API to reflect this + lv.set_tags({device_name: disk_device}) ++ return lvs + +- def generate(self, args): ++ def generate(self, args, lvs=None): + """ + Generate reports for an individual device or for all Ceph-related + devices, logical or physical, as long as they have been prepared by + this tool before and contain enough metadata. + """ + if args.device: +- return self.single_report(args.device) ++ return self.single_report(args.device, lvs) + else: +- return self.full_report() ++ return self.full_report(lvs) + +- def single_report(self, device): ++ def single_report(self, device, lvs=None): + """ + Generate a report for a single device. This can be either a logical + volume in the form of vg/lv or a device with an absolute path like + /dev/sda1 or /dev/sda + """ +- lvs = api.Volumes() ++ if lvs is None: ++ lvs = api.Volumes() + report = {} + lv = api.get_lv_from_argument(device) + +@@ -228,6 +230,7 @@ class List(object): + if lvs is None: + lvs = api.Volumes() + report = {} ++ + for lv in lvs: + try: + _id = lv.tags['ceph.osd_id'] +@@ -247,7 +250,7 @@ class List(object): + # bluestore will not have a journal, filestore will not have + # a block/wal/db, so we must skip if not present + continue +- if not api.get_lv(lv_uuid=device_uuid): ++ if not api.get_lv(lv_uuid=device_uuid, lvs=lvs): + # means we have a regular device, so query blkid + disk_device = disk.get_device_from_partuuid(device_uuid) + if disk_device: diff -Nru ceph-12.2.12/debian/patches/series ceph-12.2.12/debian/patches/series --- ceph-12.2.12/debian/patches/series 2019-08-30 11:11:09.000000000 +0200 +++ ceph-12.2.12/debian/patches/series 2019-11-06 11:25:31.000000000 +0100 @@ -17,3 +17,4 @@ civetweb-755-1.8-somaxconn-configurable.patch # RGW: GC use AIO rgw-gc-use-aio.patch +issue37490.patch diff -Nru ceph-12.2.12/src/test/debian-jessie/debian/changelog ceph-12.2.12/src/test/debian-jessie/debian/changelog --- ceph-12.2.12/src/test/debian-jessie/debian/changelog 2019-08-30 11:11:09.000000000 +0200 +++ ceph-12.2.12/src/test/debian-jessie/debian/changelog 2019-11-06 11:25:31.000000000 +0100 @@ -1,3 +1,9 @@ +ceph (12.2.12-0ubuntu0.18.04.4) bionic; urgency=medium + + * d/p/issue37490.patch: ceph-volume: reuse list of LVs (LP: #1850754). + + -- Dariusz Gadomski Wed, 06 Nov 2019 11:25:31 +0100 + ceph (12.2.12-0ubuntu0.18.04.3) bionic; urgency=medium [ James Page ] diff -Nru ceph-12.2.12/src/test/debian-jessie/debian/patches/issue37490.patch ceph-12.2.12/src/test/debian-jessie/debian/patches/issue37490.patch --- ceph-12.2.12/src/test/debian-jessie/debian/patches/issue37490.patch 1970-01-01 01:00:00.000000000 +0100 +++ ceph-12.2.12/src/test/debian-jessie/debian/patches/issue37490.patch 2019-11-06 11:25:31.000000000 +0100 @@ -0,0 +1,97 @@ +Description: ceph-volume: reuse list of LVs + Avoid creating of list of LVs in different methods of the same module + and resue them. + . + ceph (12.2.12-0ubuntu0.18.04.4) bionic; urgency=medium + . + * d/p/issue37490.patch: ceph-volume: reuse list of LVs (LP: #1850754). + +Origin: upstream, https://github.com/ceph/ceph/commit/ab3a58e78124a984d162b2f63992d01c5e59e2a7 +Bug: https://tracker.ceph.com/issues/37490 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1850754 +Last-Update: 2019-11-06 + +--- ceph-12.2.12.orig/src/ceph-volume/ceph_volume/api/lvm.py ++++ ceph-12.2.12/src/ceph-volume/ceph_volume/api/lvm.py +@@ -359,7 +359,7 @@ def get_lv_from_argument(argument): + return get_lv(lv_name=lv_name, vg_name=vg_name) + + +-def get_lv(lv_name=None, vg_name=None, lv_path=None, lv_uuid=None, lv_tags=None): ++def get_lv(lv_name=None, vg_name=None, lv_path=None, lv_uuid=None, lv_tags=None, lvs=None): + """ + Return a matching lv for the current system, requiring ``lv_name``, + ``vg_name``, ``lv_path`` or ``tags``. Raises an error if more than one lv +@@ -371,7 +371,8 @@ def get_lv(lv_name=None, vg_name=None, l + """ + if not any([lv_name, vg_name, lv_path, lv_uuid, lv_tags]): + return None +- lvs = Volumes() ++ if lvs is None: ++ lvs = Volumes() + return lvs.get( + lv_name=lv_name, vg_name=vg_name, lv_path=lv_path, lv_uuid=lv_uuid, + lv_tags=lv_tags +--- ceph-12.2.12.orig/src/ceph-volume/ceph_volume/devices/lvm/listing.py ++++ ceph-12.2.12/src/ceph-volume/ceph_volume/devices/lvm/listing.py +@@ -112,8 +112,8 @@ class List(object): + def list(self, args): + # ensure everything is up to date before calling out + # to list lv's +- self.update() +- report = self.generate(args) ++ lvs = self.update() ++ report = self.generate(args, lvs) + if args.format == 'json': + # If the report is empty, we don't return a non-zero exit status + # because it is assumed this is going to be consumed by automated +@@ -153,25 +153,27 @@ class List(object): + # this means that the device has changed, so it must be updated + # on the API to reflect this + lv.set_tags({device_name: disk_device}) ++ return lvs + +- def generate(self, args): ++ def generate(self, args, lvs=None): + """ + Generate reports for an individual device or for all Ceph-related + devices, logical or physical, as long as they have been prepared by + this tool before and contain enough metadata. + """ + if args.device: +- return self.single_report(args.device) ++ return self.single_report(args.device, lvs) + else: +- return self.full_report() ++ return self.full_report(lvs) + +- def single_report(self, device): ++ def single_report(self, device, lvs=None): + """ + Generate a report for a single device. This can be either a logical + volume in the form of vg/lv or a device with an absolute path like + /dev/sda1 or /dev/sda + """ +- lvs = api.Volumes() ++ if lvs is None: ++ lvs = api.Volumes() + report = {} + lv = api.get_lv_from_argument(device) + +@@ -228,6 +230,7 @@ class List(object): + if lvs is None: + lvs = api.Volumes() + report = {} ++ + for lv in lvs: + try: + _id = lv.tags['ceph.osd_id'] +@@ -247,7 +250,7 @@ class List(object): + # bluestore will not have a journal, filestore will not have + # a block/wal/db, so we must skip if not present + continue +- if not api.get_lv(lv_uuid=device_uuid): ++ if not api.get_lv(lv_uuid=device_uuid, lvs=lvs): + # means we have a regular device, so query blkid + disk_device = disk.get_device_from_partuuid(device_uuid) + if disk_device: diff -Nru ceph-12.2.12/src/test/debian-jessie/debian/patches/series ceph-12.2.12/src/test/debian-jessie/debian/patches/series --- ceph-12.2.12/src/test/debian-jessie/debian/patches/series 2019-08-30 11:11:09.000000000 +0200 +++ ceph-12.2.12/src/test/debian-jessie/debian/patches/series 2019-11-06 11:25:31.000000000 +0100 @@ -17,3 +17,4 @@ civetweb-755-1.8-somaxconn-configurable.patch # RGW: GC use AIO rgw-gc-use-aio.patch +issue37490.patch diff -Nru ceph-12.2.12/src/test/ubuntu-12.04/debian/changelog ceph-12.2.12/src/test/ubuntu-12.04/debian/changelog --- ceph-12.2.12/src/test/ubuntu-12.04/debian/changelog 2019-08-30 11:11:09.000000000 +0200 +++ ceph-12.2.12/src/test/ubuntu-12.04/debian/changelog 2019-11-06 11:25:31.000000000 +0100 @@ -1,3 +1,9 @@ +ceph (12.2.12-0ubuntu0.18.04.4) bionic; urgency=medium + + * d/p/issue37490.patch: ceph-volume: reuse list of LVs (LP: #1850754). + + -- Dariusz Gadomski Wed, 06 Nov 2019 11:25:31 +0100 + ceph (12.2.12-0ubuntu0.18.04.3) bionic; urgency=medium [ James Page ] diff -Nru ceph-12.2.12/src/test/ubuntu-12.04/debian/patches/issue37490.patch ceph-12.2.12/src/test/ubuntu-12.04/debian/patches/issue37490.patch --- ceph-12.2.12/src/test/ubuntu-12.04/debian/patches/issue37490.patch 1970-01-01 01:00:00.000000000 +0100 +++ ceph-12.2.12/src/test/ubuntu-12.04/debian/patches/issue37490.patch 2019-11-06 11:25:31.000000000 +0100 @@ -0,0 +1,97 @@ +Description: ceph-volume: reuse list of LVs + Avoid creating of list of LVs in different methods of the same module + and resue them. + . + ceph (12.2.12-0ubuntu0.18.04.4) bionic; urgency=medium + . + * d/p/issue37490.patch: ceph-volume: reuse list of LVs (LP: #1850754). + +Origin: upstream, https://github.com/ceph/ceph/commit/ab3a58e78124a984d162b2f63992d01c5e59e2a7 +Bug: https://tracker.ceph.com/issues/37490 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1850754 +Last-Update: 2019-11-06 + +--- ceph-12.2.12.orig/src/ceph-volume/ceph_volume/api/lvm.py ++++ ceph-12.2.12/src/ceph-volume/ceph_volume/api/lvm.py +@@ -359,7 +359,7 @@ def get_lv_from_argument(argument): + return get_lv(lv_name=lv_name, vg_name=vg_name) + + +-def get_lv(lv_name=None, vg_name=None, lv_path=None, lv_uuid=None, lv_tags=None): ++def get_lv(lv_name=None, vg_name=None, lv_path=None, lv_uuid=None, lv_tags=None, lvs=None): + """ + Return a matching lv for the current system, requiring ``lv_name``, + ``vg_name``, ``lv_path`` or ``tags``. Raises an error if more than one lv +@@ -371,7 +371,8 @@ def get_lv(lv_name=None, vg_name=None, l + """ + if not any([lv_name, vg_name, lv_path, lv_uuid, lv_tags]): + return None +- lvs = Volumes() ++ if lvs is None: ++ lvs = Volumes() + return lvs.get( + lv_name=lv_name, vg_name=vg_name, lv_path=lv_path, lv_uuid=lv_uuid, + lv_tags=lv_tags +--- ceph-12.2.12.orig/src/ceph-volume/ceph_volume/devices/lvm/listing.py ++++ ceph-12.2.12/src/ceph-volume/ceph_volume/devices/lvm/listing.py +@@ -112,8 +112,8 @@ class List(object): + def list(self, args): + # ensure everything is up to date before calling out + # to list lv's +- self.update() +- report = self.generate(args) ++ lvs = self.update() ++ report = self.generate(args, lvs) + if args.format == 'json': + # If the report is empty, we don't return a non-zero exit status + # because it is assumed this is going to be consumed by automated +@@ -153,25 +153,27 @@ class List(object): + # this means that the device has changed, so it must be updated + # on the API to reflect this + lv.set_tags({device_name: disk_device}) ++ return lvs + +- def generate(self, args): ++ def generate(self, args, lvs=None): + """ + Generate reports for an individual device or for all Ceph-related + devices, logical or physical, as long as they have been prepared by + this tool before and contain enough metadata. + """ + if args.device: +- return self.single_report(args.device) ++ return self.single_report(args.device, lvs) + else: +- return self.full_report() ++ return self.full_report(lvs) + +- def single_report(self, device): ++ def single_report(self, device, lvs=None): + """ + Generate a report for a single device. This can be either a logical + volume in the form of vg/lv or a device with an absolute path like + /dev/sda1 or /dev/sda + """ +- lvs = api.Volumes() ++ if lvs is None: ++ lvs = api.Volumes() + report = {} + lv = api.get_lv_from_argument(device) + +@@ -228,6 +230,7 @@ class List(object): + if lvs is None: + lvs = api.Volumes() + report = {} ++ + for lv in lvs: + try: + _id = lv.tags['ceph.osd_id'] +@@ -247,7 +250,7 @@ class List(object): + # bluestore will not have a journal, filestore will not have + # a block/wal/db, so we must skip if not present + continue +- if not api.get_lv(lv_uuid=device_uuid): ++ if not api.get_lv(lv_uuid=device_uuid, lvs=lvs): + # means we have a regular device, so query blkid + disk_device = disk.get_device_from_partuuid(device_uuid) + if disk_device: diff -Nru ceph-12.2.12/src/test/ubuntu-12.04/debian/patches/series ceph-12.2.12/src/test/ubuntu-12.04/debian/patches/series --- ceph-12.2.12/src/test/ubuntu-12.04/debian/patches/series 2019-08-30 11:11:09.000000000 +0200 +++ ceph-12.2.12/src/test/ubuntu-12.04/debian/patches/series 2019-11-06 11:25:31.000000000 +0100 @@ -17,3 +17,4 @@ civetweb-755-1.8-somaxconn-configurable.patch # RGW: GC use AIO rgw-gc-use-aio.patch +issue37490.patch diff -Nru ceph-12.2.12/src/test/ubuntu-14.04/debian/changelog ceph-12.2.12/src/test/ubuntu-14.04/debian/changelog --- ceph-12.2.12/src/test/ubuntu-14.04/debian/changelog 2019-08-30 11:11:09.000000000 +0200 +++ ceph-12.2.12/src/test/ubuntu-14.04/debian/changelog 2019-11-06 11:25:31.000000000 +0100 @@ -1,3 +1,9 @@ +ceph (12.2.12-0ubuntu0.18.04.4) bionic; urgency=medium + + * d/p/issue37490.patch: ceph-volume: reuse list of LVs (LP: #1850754). + + -- Dariusz Gadomski Wed, 06 Nov 2019 11:25:31 +0100 + ceph (12.2.12-0ubuntu0.18.04.3) bionic; urgency=medium [ James Page ] diff -Nru ceph-12.2.12/src/test/ubuntu-14.04/debian/patches/issue37490.patch ceph-12.2.12/src/test/ubuntu-14.04/debian/patches/issue37490.patch --- ceph-12.2.12/src/test/ubuntu-14.04/debian/patches/issue37490.patch 1970-01-01 01:00:00.000000000 +0100 +++ ceph-12.2.12/src/test/ubuntu-14.04/debian/patches/issue37490.patch 2019-11-06 11:25:31.000000000 +0100 @@ -0,0 +1,97 @@ +Description: ceph-volume: reuse list of LVs + Avoid creating of list of LVs in different methods of the same module + and resue them. + . + ceph (12.2.12-0ubuntu0.18.04.4) bionic; urgency=medium + . + * d/p/issue37490.patch: ceph-volume: reuse list of LVs (LP: #1850754). + +Origin: upstream, https://github.com/ceph/ceph/commit/ab3a58e78124a984d162b2f63992d01c5e59e2a7 +Bug: https://tracker.ceph.com/issues/37490 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1850754 +Last-Update: 2019-11-06 + +--- ceph-12.2.12.orig/src/ceph-volume/ceph_volume/api/lvm.py ++++ ceph-12.2.12/src/ceph-volume/ceph_volume/api/lvm.py +@@ -359,7 +359,7 @@ def get_lv_from_argument(argument): + return get_lv(lv_name=lv_name, vg_name=vg_name) + + +-def get_lv(lv_name=None, vg_name=None, lv_path=None, lv_uuid=None, lv_tags=None): ++def get_lv(lv_name=None, vg_name=None, lv_path=None, lv_uuid=None, lv_tags=None, lvs=None): + """ + Return a matching lv for the current system, requiring ``lv_name``, + ``vg_name``, ``lv_path`` or ``tags``. Raises an error if more than one lv +@@ -371,7 +371,8 @@ def get_lv(lv_name=None, vg_name=None, l + """ + if not any([lv_name, vg_name, lv_path, lv_uuid, lv_tags]): + return None +- lvs = Volumes() ++ if lvs is None: ++ lvs = Volumes() + return lvs.get( + lv_name=lv_name, vg_name=vg_name, lv_path=lv_path, lv_uuid=lv_uuid, + lv_tags=lv_tags +--- ceph-12.2.12.orig/src/ceph-volume/ceph_volume/devices/lvm/listing.py ++++ ceph-12.2.12/src/ceph-volume/ceph_volume/devices/lvm/listing.py +@@ -112,8 +112,8 @@ class List(object): + def list(self, args): + # ensure everything is up to date before calling out + # to list lv's +- self.update() +- report = self.generate(args) ++ lvs = self.update() ++ report = self.generate(args, lvs) + if args.format == 'json': + # If the report is empty, we don't return a non-zero exit status + # because it is assumed this is going to be consumed by automated +@@ -153,25 +153,27 @@ class List(object): + # this means that the device has changed, so it must be updated + # on the API to reflect this + lv.set_tags({device_name: disk_device}) ++ return lvs + +- def generate(self, args): ++ def generate(self, args, lvs=None): + """ + Generate reports for an individual device or for all Ceph-related + devices, logical or physical, as long as they have been prepared by + this tool before and contain enough metadata. + """ + if args.device: +- return self.single_report(args.device) ++ return self.single_report(args.device, lvs) + else: +- return self.full_report() ++ return self.full_report(lvs) + +- def single_report(self, device): ++ def single_report(self, device, lvs=None): + """ + Generate a report for a single device. This can be either a logical + volume in the form of vg/lv or a device with an absolute path like + /dev/sda1 or /dev/sda + """ +- lvs = api.Volumes() ++ if lvs is None: ++ lvs = api.Volumes() + report = {} + lv = api.get_lv_from_argument(device) + +@@ -228,6 +230,7 @@ class List(object): + if lvs is None: + lvs = api.Volumes() + report = {} ++ + for lv in lvs: + try: + _id = lv.tags['ceph.osd_id'] +@@ -247,7 +250,7 @@ class List(object): + # bluestore will not have a journal, filestore will not have + # a block/wal/db, so we must skip if not present + continue +- if not api.get_lv(lv_uuid=device_uuid): ++ if not api.get_lv(lv_uuid=device_uuid, lvs=lvs): + # means we have a regular device, so query blkid + disk_device = disk.get_device_from_partuuid(device_uuid) + if disk_device: diff -Nru ceph-12.2.12/src/test/ubuntu-14.04/debian/patches/series ceph-12.2.12/src/test/ubuntu-14.04/debian/patches/series --- ceph-12.2.12/src/test/ubuntu-14.04/debian/patches/series 2019-08-30 11:11:09.000000000 +0200 +++ ceph-12.2.12/src/test/ubuntu-14.04/debian/patches/series 2019-11-06 11:25:31.000000000 +0100 @@ -17,3 +17,4 @@ civetweb-755-1.8-somaxconn-configurable.patch # RGW: GC use AIO rgw-gc-use-aio.patch +issue37490.patch diff -Nru ceph-12.2.12/src/test/ubuntu-16.04/debian/changelog ceph-12.2.12/src/test/ubuntu-16.04/debian/changelog --- ceph-12.2.12/src/test/ubuntu-16.04/debian/changelog 2019-08-30 11:11:09.000000000 +0200 +++ ceph-12.2.12/src/test/ubuntu-16.04/debian/changelog 2019-11-06 11:25:31.000000000 +0100 @@ -1,3 +1,9 @@ +ceph (12.2.12-0ubuntu0.18.04.4) bionic; urgency=medium + + * d/p/issue37490.patch: ceph-volume: reuse list of LVs (LP: #1850754). + + -- Dariusz Gadomski Wed, 06 Nov 2019 11:25:31 +0100 + ceph (12.2.12-0ubuntu0.18.04.3) bionic; urgency=medium [ James Page ] diff -Nru ceph-12.2.12/src/test/ubuntu-16.04/debian/patches/issue37490.patch ceph-12.2.12/src/test/ubuntu-16.04/debian/patches/issue37490.patch --- ceph-12.2.12/src/test/ubuntu-16.04/debian/patches/issue37490.patch 1970-01-01 01:00:00.000000000 +0100 +++ ceph-12.2.12/src/test/ubuntu-16.04/debian/patches/issue37490.patch 2019-11-06 11:25:31.000000000 +0100 @@ -0,0 +1,97 @@ +Description: ceph-volume: reuse list of LVs + Avoid creating of list of LVs in different methods of the same module + and resue them. + . + ceph (12.2.12-0ubuntu0.18.04.4) bionic; urgency=medium + . + * d/p/issue37490.patch: ceph-volume: reuse list of LVs (LP: #1850754). + +Origin: upstream, https://github.com/ceph/ceph/commit/ab3a58e78124a984d162b2f63992d01c5e59e2a7 +Bug: https://tracker.ceph.com/issues/37490 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1850754 +Last-Update: 2019-11-06 + +--- ceph-12.2.12.orig/src/ceph-volume/ceph_volume/api/lvm.py ++++ ceph-12.2.12/src/ceph-volume/ceph_volume/api/lvm.py +@@ -359,7 +359,7 @@ def get_lv_from_argument(argument): + return get_lv(lv_name=lv_name, vg_name=vg_name) + + +-def get_lv(lv_name=None, vg_name=None, lv_path=None, lv_uuid=None, lv_tags=None): ++def get_lv(lv_name=None, vg_name=None, lv_path=None, lv_uuid=None, lv_tags=None, lvs=None): + """ + Return a matching lv for the current system, requiring ``lv_name``, + ``vg_name``, ``lv_path`` or ``tags``. Raises an error if more than one lv +@@ -371,7 +371,8 @@ def get_lv(lv_name=None, vg_name=None, l + """ + if not any([lv_name, vg_name, lv_path, lv_uuid, lv_tags]): + return None +- lvs = Volumes() ++ if lvs is None: ++ lvs = Volumes() + return lvs.get( + lv_name=lv_name, vg_name=vg_name, lv_path=lv_path, lv_uuid=lv_uuid, + lv_tags=lv_tags +--- ceph-12.2.12.orig/src/ceph-volume/ceph_volume/devices/lvm/listing.py ++++ ceph-12.2.12/src/ceph-volume/ceph_volume/devices/lvm/listing.py +@@ -112,8 +112,8 @@ class List(object): + def list(self, args): + # ensure everything is up to date before calling out + # to list lv's +- self.update() +- report = self.generate(args) ++ lvs = self.update() ++ report = self.generate(args, lvs) + if args.format == 'json': + # If the report is empty, we don't return a non-zero exit status + # because it is assumed this is going to be consumed by automated +@@ -153,25 +153,27 @@ class List(object): + # this means that the device has changed, so it must be updated + # on the API to reflect this + lv.set_tags({device_name: disk_device}) ++ return lvs + +- def generate(self, args): ++ def generate(self, args, lvs=None): + """ + Generate reports for an individual device or for all Ceph-related + devices, logical or physical, as long as they have been prepared by + this tool before and contain enough metadata. + """ + if args.device: +- return self.single_report(args.device) ++ return self.single_report(args.device, lvs) + else: +- return self.full_report() ++ return self.full_report(lvs) + +- def single_report(self, device): ++ def single_report(self, device, lvs=None): + """ + Generate a report for a single device. This can be either a logical + volume in the form of vg/lv or a device with an absolute path like + /dev/sda1 or /dev/sda + """ +- lvs = api.Volumes() ++ if lvs is None: ++ lvs = api.Volumes() + report = {} + lv = api.get_lv_from_argument(device) + +@@ -228,6 +230,7 @@ class List(object): + if lvs is None: + lvs = api.Volumes() + report = {} ++ + for lv in lvs: + try: + _id = lv.tags['ceph.osd_id'] +@@ -247,7 +250,7 @@ class List(object): + # bluestore will not have a journal, filestore will not have + # a block/wal/db, so we must skip if not present + continue +- if not api.get_lv(lv_uuid=device_uuid): ++ if not api.get_lv(lv_uuid=device_uuid, lvs=lvs): + # means we have a regular device, so query blkid + disk_device = disk.get_device_from_partuuid(device_uuid) + if disk_device: diff -Nru ceph-12.2.12/src/test/ubuntu-16.04/debian/patches/series ceph-12.2.12/src/test/ubuntu-16.04/debian/patches/series --- ceph-12.2.12/src/test/ubuntu-16.04/debian/patches/series 2019-08-30 11:11:09.000000000 +0200 +++ ceph-12.2.12/src/test/ubuntu-16.04/debian/patches/series 2019-11-06 11:25:31.000000000 +0100 @@ -17,3 +17,4 @@ civetweb-755-1.8-somaxconn-configurable.patch # RGW: GC use AIO rgw-gc-use-aio.patch +issue37490.patch