mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
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.
This commit is contained in:
parent
74878bc2bc
commit
7baf411c97
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.105 -
|
Version 2.02.105 -
|
||||||
=====================================
|
=====================================
|
||||||
|
Return success when inserting dirs and links into device cache.
|
||||||
Test for remote exclusive activation after activation fails.
|
Test for remote exclusive activation after activation fails.
|
||||||
Support lvconvert --merge for thin snapshots.
|
Support lvconvert --merge for thin snapshots.
|
||||||
Add support to read thin device id from table line entry.
|
Add support to read thin device id from table line entry.
|
||||||
|
@ -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)
|
static int _insert(const char *path, int rec, int check_with_udev_db)
|
||||||
{
|
{
|
||||||
struct stat info;
|
struct stat info;
|
||||||
int r = 0;
|
|
||||||
|
|
||||||
if (stat(path, &info) < 0) {
|
if (stat(path, &info) < 0) {
|
||||||
log_sys_very_verbose("stat", path);
|
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)) {
|
if (S_ISLNK(info.st_mode)) {
|
||||||
log_debug_devs("%s: Symbolic link to directory", path);
|
log_debug_devs("%s: Symbolic link to directory", path);
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rec)
|
if (rec && !_insert_dir(path))
|
||||||
r = _insert_dir(path);
|
return_0;
|
||||||
|
|
||||||
} else { /* add a device */
|
} else { /* add a device */
|
||||||
if (!S_ISBLK(info.st_mode)) {
|
if (!S_ISBLK(info.st_mode)) {
|
||||||
log_debug_devs("%s: Not a block device", path);
|
log_debug_devs("%s: Not a block device", path);
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_insert_dev(path, info.st_rdev))
|
if (!_insert_dev(path, info.st_rdev))
|
||||||
return_0;
|
return_0;
|
||||||
|
|
||||||
r = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return r;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _full_scan(int dev_scan)
|
static void _full_scan(int dev_scan)
|
||||||
|
Loading…
Reference in New Issue
Block a user