summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhao Heming <heming.zhao@suse.com>2020-06-01 12:22:15 -0500
committerDavid Teigland <teigland@redhat.com>2020-06-01 12:22:15 -0500
commitb59127a8386a407407a0361b9bcad028ce31a733 (patch)
treed5b84214481dde250e2eb9ce08691cef39b41238
parentd14a8040d4a2b264130cdb730cead935b0bf19f0 (diff)
downloadlvm2-b59127a8386a407407a0361b9bcad028ce31a733.tar.gz
Change dev->bcache_fd default value from 0 to -1
This fix can avoid bcache_fd will mistakenly open/close in later. Signed-off-by: Zhao Heming <heming.zhao@suse.com>
-rw-r--r--lib/device/dev-cache.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index 6af559cab..c3f7c49be 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;