summaryrefslogtreecommitdiffstats
path: root/shlibs/mount/src/tab.c
diff options
context:
space:
mode:
authorKarel Zak2010-03-12 23:42:56 +0100
committerKarel Zak2010-06-03 15:20:11 +0200
commitba7232a1fe1398e7947d1af39fadc8d02b21bf69 (patch)
treedfa9aeae8f08bf02582055b4794164b91da4f947 /shlibs/mount/src/tab.c
parentlibmount: add support for userdata and work with VFS tree (diff)
downloadkernel-qcow2-util-linux-ba7232a1fe1398e7947d1af39fadc8d02b21bf69.tar.gz
kernel-qcow2-util-linux-ba7232a1fe1398e7947d1af39fadc8d02b21bf69.tar.xz
kernel-qcow2-util-linux-ba7232a1fe1398e7947d1af39fadc8d02b21bf69.zip
libmount: add mnt_cache_find_tag_value()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/mount/src/tab.c')
-rw-r--r--shlibs/mount/src/tab.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/shlibs/mount/src/tab.c b/shlibs/mount/src/tab.c
index 98c56602b..176a7d5a7 100644
--- a/shlibs/mount/src/tab.c
+++ b/shlibs/mount/src/tab.c
@@ -519,9 +519,11 @@ mnt_fs *mnt_tab_find_srcpath(mnt_tab *tb, const char *path, int direction)
/* evaluated tag */
if (ntags) {
+ int rc = mnt_cache_read_tags(tb->cache, cn);
+
mnt_reset_iter(&itr, direction);
- if (mnt_cache_read_tags(tb->cache, cn) > 0) {
+ if (rc == 0) {
/* @path's TAGs are in the cache */
while(mnt_tab_next_fs(tb, &itr, &fs) == 0) {
const char *t, *v;
@@ -532,7 +534,7 @@ mnt_fs *mnt_tab_find_srcpath(mnt_tab *tb, const char *path, int direction)
if (mnt_cache_device_has_tag(tb->cache, cn, t, v))
return fs;
}
- } else if (errno == EACCES) {
+ } else if (rc < 0 && errno == EACCES) {
/* @path is unaccessible, try evaluate all TAGs in @tb
* by udev symlinks -- this could be expensive on systems
* with huge fstab/mtab */