linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] [PATCH] Change dev->bcache_fd default value from 0 to -1
@ 2020-05-31  8:46 Zhao Heming
  0 siblings, 0 replies; only message in thread
From: Zhao Heming @ 2020-05-31  8:46 UTC (permalink / raw)
  To: linux-lvm; +Cc: Zhao Heming

This fix can avoid bcache_fd will mistakenly open/close in later.

Signed-off-by: Zhao Heming <heming.zhao@suse.com>
---
 lib/device/dev-cache.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index 6af559c..c3f7c49 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -65,6 +65,7 @@ static int _insert(const char *path, const struct stat *info,
 static void _dev_init(struct device *dev)
 {
 	dev->fd = -1;
+	dev->bcache_fd = -1;
 	dev->read_ahead = -1;
 
 	dev->ext.enabled = 0;
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-31  8:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-31  8:46 [linux-lvm] [PATCH] Change dev->bcache_fd default value from 0 to -1 Zhao Heming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).