Skip to contentSkip to conversation

master - hints: check for _touch_hints

PATCH Zdenek Kabelac 1 participant 1 message Nov 14, 2019

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=61a483a654d87fc514dd4e7570467797247b6031
Commit:        61a483a654d87fc514dd4e7570467797247b6031
Parent:        c38be0653111e3d63efbbf2f8914c83f15a73e70
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Thu Nov 14 18:01:05 2019 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Thu Nov 14 18:06:42 2019 +0100

hints: check for _touch_hints

Exit when !_touch_hints().

---
 lib/label/hints.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
lib/label/hints.c +3 -2
index 8739f33..c6039d5 100644
@@ -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 */