diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2013-12-05 11:11:26 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2013-12-05 11:17:37 +0100 |
commit | 7baf411c9774d8e51ccc8bff9399562da69906a3 (patch) | |
tree | b444471da160668f60bf6d3887d337c5f727db5c | |
parent | 74878bc2bcd66d60a0b53f409a30271496acd348 (diff) | |
download | lvm2-7baf411c9774d8e51ccc8bff9399562da69906a3.tar.gz |
dev-cache: return success when ignoring dirs
When there is no failure from the insert operation itself,
just dirs and links are skipped - return success.
-rw-r--r-- | WHATS_NEW | 1 | ||||
-rw-r--r-- | lib/device/dev-cache.c | 14 |
2 files changed, 6 insertions, 9 deletions
@@ -1,5 +1,6 @@ Version 2.02.105 - ===================================== + Return success when inserting dirs and links into device cache. Test for remote exclusive activation after activation fails. Support lvconvert --merge for thin snapshots. Add support to read thin device id from table line entry. diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c index 94513146f..bbdde92d1 100644 --- a/lib/device/dev-cache.c +++ b/lib/device/dev-cache.c @@ -592,7 +592,6 @@ static void _insert_dirs(struct dm_list *dirs) static int _insert(const char *path, int rec, int check_with_udev_db) { struct stat info; - int r = 0; if (stat(path, &info) < 0) { log_sys_very_verbose("stat", path); @@ -613,25 +612,22 @@ static int _insert(const char *path, int rec, int check_with_udev_db) if (S_ISLNK(info.st_mode)) { log_debug_devs("%s: Symbolic link to directory", path); - return 0; + return 1; } - if (rec) - r = _insert_dir(path); - + if (rec && !_insert_dir(path)) + return_0; } else { /* add a device */ if (!S_ISBLK(info.st_mode)) { log_debug_devs("%s: Not a block device", path); - return 0; + return 1; } if (!_insert_dev(path, info.st_rdev)) return_0; - - r = 1; } - return r; + return 1; } static void _full_scan(int dev_scan) |