diff -Nru lvm2-2.03.07/debian/changelog lvm2-2.03.07/debian/changelog --- lvm2-2.03.07/debian/changelog 2020-02-13 21:21:51.000000000 +0000 +++ lvm2-2.03.07/debian/changelog 2022-05-30 17:56:52.000000000 +0000 @@ -1,3 +1,10 @@ +lvm2 (2.03.07-1ubuntu1+lp1834250) focal; urgency=low + + * d/p/reduce-device-path-error-messsages.patch: Silence "No medium + found" errors from card readers on "update-grub" (LP: #1834250) + + -- Mauricio Faria de Oliveira Mon, 30 May 2022 14:56:52 -0300 + lvm2 (2.03.07-1ubuntu1) focal; urgency=low * Merge from Debian unstable. Remaining changes: diff -Nru lvm2-2.03.07/debian/patches/reduce-device-path-error-messsages.patch lvm2-2.03.07/debian/patches/reduce-device-path-error-messsages.patch --- lvm2-2.03.07/debian/patches/reduce-device-path-error-messsages.patch 1970-01-01 00:00:00.000000000 +0000 +++ lvm2-2.03.07/debian/patches/reduce-device-path-error-messsages.patch 2022-05-30 17:56:52.000000000 +0000 @@ -0,0 +1,103 @@ +Origin: upstream, https://sourceware.org/git/?p=lvm2.git;a=commit;h=957904933b2b0f94eddc6204ca2fa61e2df741a1 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1834250 +From: David Teigland +Date: Thu, 12 Mar 2020 10:18:51 -0500 +Subject: [PATCH] reduce device path error messsages + +When /dev entries or sysfs entries are changing +due to concurrent lvm commands, it can cause +warning/error messages about missing paths. +--- + lib/device/dev-cache.c | 9 +++++++-- + lib/device/dev-io.c | 8 +++++--- + lib/device/dev-type.c | 2 +- + 3 files changed, 13 insertions(+), 6 deletions(-) + +diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c +index e17b13f013d5..6af559cabbd9 100644 +--- a/lib/device/dev-cache.c ++++ b/lib/device/dev-cache.c +@@ -357,12 +357,14 @@ static int _get_sysfs_value(const char *path, char *buf, size_t buf_size, int er + int r = 0; + + if (!(fp = fopen(path, "r"))) { +- log_sys_error("fopen", path); ++ if (error_if_no_value) ++ log_sys_error("fopen", path); + return 0; + } + + if (!fgets(buf, buf_size, fp)) { +- log_sys_error("fgets", path); ++ if (error_if_no_value) ++ log_sys_error("fgets", path); + goto out; + } + +@@ -1460,6 +1462,7 @@ struct device *dev_cache_get(struct cmd_context *cmd, const char *name, struct d + _insert(name, info_available ? &buf : NULL, 0, obtain_device_list_from_udev()); + d = (struct device *) dm_hash_lookup(_cache.names, name); + if (!d) { ++ log_debug_devs("Device name not found in dev_cache repeat dev_cache_scan for %s", name); + dev_cache_scan(); + d = (struct device *) dm_hash_lookup(_cache.names, name); + } +@@ -1535,6 +1538,8 @@ struct device *dev_cache_get_by_devt(struct cmd_context *cmd, dev_t dev, struct + } + } + ++ log_debug_devs("Device num not found in dev_cache repeat dev_cache_scan for %d:%d", ++ (int)MAJOR(dev), (int)MINOR(dev)); + dev_cache_scan(); + d = _dev_cache_seek_devt(dev); + } +diff --git a/lib/device/dev-io.c b/lib/device/dev-io.c +index dd65c3d2ebc5..735441f19970 100644 +--- a/lib/device/dev-io.c ++++ b/lib/device/dev-io.c +@@ -94,7 +94,7 @@ static int _dev_get_size_dev(struct device *dev, uint64_t *size) + } + + if (fd <= 0) { +- if (!dev_open_readonly(dev)) ++ if (!dev_open_readonly_quiet(dev)) + return_0; + fd = dev_fd(dev); + do_close = 1; +@@ -128,8 +128,10 @@ static int _dev_read_ahead_dev(struct device *dev, uint32_t *read_ahead) + return 1; + } + +- if (!dev_open_readonly(dev)) ++ if (!dev_open_readonly_quiet(dev)) { ++ log_error("Failed to open to get readahead %s", dev_name(dev)); + return_0; ++ } + + if (ioctl(dev->fd, BLKRAGET, &read_ahead_long) < 0) { + log_sys_error("ioctl BLKRAGET", dev_name(dev)); +@@ -194,7 +196,7 @@ int dev_get_direct_block_sizes(struct device *dev, unsigned int *physical_block_ + } + + if (fd <= 0) { +- if (!dev_open_readonly(dev)) ++ if (!dev_open_readonly_quiet(dev)) + return 0; + fd = dev_fd(dev); + do_close = 1; +diff --git a/lib/device/dev-type.c b/lib/device/dev-type.c +index fba4dc917fa9..d225d4d90315 100644 +--- a/lib/device/dev-type.c ++++ b/lib/device/dev-type.c +@@ -86,7 +86,7 @@ int dev_is_lv(struct device *dev) + return 0; + + if (!fgets(buffer, sizeof(buffer), fp)) +- log_warn("Failed to read %s.", path); ++ log_debug("Failed to read %s.", path); + else if (!strncmp(buffer, "LVM-", 4)) + ret = 1; + +-- +2.34.1 + diff -Nru lvm2-2.03.07/debian/patches/series lvm2-2.03.07/debian/patches/series --- lvm2-2.03.07/debian/patches/series 2020-02-13 21:21:51.000000000 +0000 +++ lvm2-2.03.07/debian/patches/series 2022-05-30 17:56:52.000000000 +0000 @@ -4,3 +4,4 @@ blkdeactivate-use-usr-bin-sort.patch fix-systemd-run-location.patch Detect-systemd-at-run-time-in-69-dm-lvm-metad.rules.patch +reduce-device-path-error-messsages.patch