From 61a483a654d87fc514dd4e7570467797247b6031 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 14 Nov 2019 18:01:05 +0100 Subject: [PATCH] hints: check for _touch_hints Exit when !_touch_hints(). --- lib/label/hints.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/label/hints.c b/lib/label/hints.c index 8739f337d..c6039d555 100644 --- a/lib/label/hints.c +++ b/lib/label/hints.c @@ -1261,8 +1261,9 @@ int get_hints(struct cmd_context *cmd, struct dm_list *hints_out, int *newhints, */ if (_newhints_exists()) { log_debug("get_hints: newhints file"); - if (!_hints_exists()) - _touch_hints(); + if (!_hints_exists() && !_touch_hints()) + return 0; + if (!_lock_hints(cmd, LOCK_EX, NONBLOCK)) return 0; /* create new hints after scan */ -- 2.43.5