diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2011-10-14 13:23:47 +0000 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2011-10-14 13:23:47 +0000 |
commit | 7f815706ca2a8dd00d055b5d7b318cbcf05f5fee (patch) | |
tree | 809060f8a456c0f03fd9bfe44308f1010ff48a9f /lib/activate | |
parent | 5ba3b21921d8f332d96bea15978838a8023d2af4 (diff) | |
download | lvm2-7f815706ca2a8dd00d055b5d7b318cbcf05f5fee.tar.gz lvm2-7f815706ca2a8dd00d055b5d7b318cbcf05f5fee.tar.xz lvm2-7f815706ca2a8dd00d055b5d7b318cbcf05f5fee.zip |
Fix lv_info open_count test
When verify_udev_operations was disable, code for stacking fs operation for
lvm links was completely disable - but this code was also used for collecting
information, that a new node is being created.
Add a new flag which is set when a creation of lv symlinks is requested which
should restore old behaviour of lv_info function, that has called fs_sync()
before quere for open count on device.
Diffstat (limited to 'lib/activate')
-rw-r--r-- | lib/activate/dev_manager.c | 4 | ||||
-rw-r--r-- | lib/activate/fs.c | 10 | ||||
-rw-r--r-- | lib/activate/fs.h | 1 |
3 files changed, 13 insertions, 2 deletions
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c index fb269e42..a9a1b610 100644 --- a/lib/activate/dev_manager.c +++ b/lib/activate/dev_manager.c @@ -1746,8 +1746,10 @@ static int _create_lv_symlinks(struct dev_manager *dm, struct dm_tree_node *root int r = 1; /* Nothing to do if udev fallback is disabled. */ - if (!dm->cmd->current_settings.udev_fallback) + if (!dm->cmd->current_settings.udev_fallback) { + fs_set_create(); return 1; + } while ((child = dm_tree_next_child(&handle, root, 0))) { if (!(lvlayer = dm_tree_node_get_context(child))) diff --git a/lib/activate/fs.c b/lib/activate/fs.c index a18125ed..f9eb2808 100644 --- a/lib/activate/fs.c +++ b/lib/activate/fs.c @@ -32,6 +32,7 @@ * Supports to wait for udev device settle only when needed. */ static uint32_t _fs_cookie = DM_COOKIE_AUTO_CREATE; +static int _fs_create = 0; static int _mk_dir(const char *dev_dir, const char *vg_name) { @@ -427,6 +428,8 @@ static void _pop_fs_ops(void) fsp->dev, fsp->old_lv_name, fsp->check_udev); _del_fs_op(fsp); } + + _fs_create = 0; } static int _fs_op(fs_op_t type, const char *dev_dir, const char *vg_name, @@ -500,7 +503,12 @@ void fs_set_cookie(uint32_t cookie) _fs_cookie = cookie; } +void fs_set_create(void) +{ + _fs_create = 1; +} + int fs_has_non_delete_ops(void) { - return _other_fs_ops(FS_DEL); + return _fs_create || _other_fs_ops(FS_DEL); } diff --git a/lib/activate/fs.h b/lib/activate/fs.h index 43e2846a..9e433c8e 100644 --- a/lib/activate/fs.h +++ b/lib/activate/fs.h @@ -32,6 +32,7 @@ int fs_rename_lv(struct logical_volume *lv, const char *dev, /* void fs_unlock(void); moved to activate.h */ uint32_t fs_get_cookie(void); void fs_set_cookie(uint32_t cookie); +void fs_set_create(void); int fs_has_non_delete_ops(void); #endif |