lvm2/bug-1150021_05-bcache-bcache_invalidate_fd-only-remove-prefixes-on.patch
Gang He b74c0695d2 Accepting request 759060 from home:hmzhao:branches:openSUSE:Factory
LVM Metadata Error: Error writing device at 4096 length 512 (bsc#1150021)
 + bug-1150021_01-scanning-open-devs-rw-when-rescanning-for-write.patch
 + bug-1150021_02-bcache-add-bcache_abort.patch
 + bug-1150021_03-label-Use-bcache_abort_fd-to-ensure-blocks-are-no-lo.patch
 + bug-1150021_04-bcache-add-unit-test.patch
 + bug-1150021_05-bcache-bcache_invalidate_fd-only-remove-prefixes-on.patch
 + bug-1150021_06-fix-dev_unset_last_byte-after-write-error.patch
- Update patch, according to bug-1150021_01-scanning-xxx.patch
 + bug-1158861_06-fix-segfault-for-invalid-characters-in-vg-name.patch

OBS-URL: https://build.opensuse.org/request/show/759060
OBS-URL: https://build.opensuse.org/package/show/Base:System/lvm2?expand=0&rev=263
2019-12-25 02:03:58 +00:00

30 lines
892 B
Diff

From 25e7bf021a4e7c5ad5f925b86605bf025ff1a949 Mon Sep 17 00:00:00 2001
From: Joe Thornber <ejt@redhat.com>
Date: Tue, 29 Oct 2019 15:21:11 +0000
Subject: [PATCH] [bcache] bcache_invalidate_fd, only remove prefixes on
success.
---
lib/device/bcache.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/device/bcache.c b/lib/device/bcache.c
index b0edf28062..04d49f1656 100644
--- a/lib/device/bcache.c
+++ b/lib/device/bcache.c
@@ -1376,7 +1376,10 @@ bool bcache_invalidate_fd(struct bcache *cache, int fd)
it.success = true;
it.it.visit = _invalidate_v;
radix_tree_iterate(cache->rtree, k.bytes, k.bytes + sizeof(k.parts.fd), &it.it);
- radix_tree_remove_prefix(cache->rtree, k.bytes, k.bytes + sizeof(k.parts.fd));
+
+ if (it.success)
+ radix_tree_remove_prefix(cache->rtree, k.bytes, k.bytes + sizeof(k.parts.fd));
+
return it.success;
}
--
2.16.4