summaryrefslogtreecommitdiffstats
path: root/libmount/src/tab.c
diff options
context:
space:
mode:
authorKarel Zak2017-02-28 14:47:02 +0100
committerKarel Zak2017-02-28 14:47:02 +0100
commit7bb9ee99da6558f75a1931bb95580124853f3e06 (patch)
tree3a64823cf6d975508351bc2004e578799e5ead4b /libmount/src/tab.c
parentlibmount: return tab entry for default node (diff)
downloadkernel-qcow2-util-linux-7bb9ee99da6558f75a1931bb95580124853f3e06.tar.gz
kernel-qcow2-util-linux-7bb9ee99da6558f75a1931bb95580124853f3e06.tar.xz
kernel-qcow2-util-linux-7bb9ee99da6558f75a1931bb95580124853f3e06.zip
libmount: cosmetic change to mnt_table_find_srcpath()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/tab.c')
-rw-r--r--libmount/src/tab.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/libmount/src/tab.c b/libmount/src/tab.c
index c86ff7951..10da730e3 100644
--- a/libmount/src/tab.c
+++ b/libmount/src/tab.c
@@ -965,18 +965,17 @@ struct libmnt_fs *mnt_table_find_srcpath(struct libmnt_table *tb, const char *pa
if (mnt_fs_streq_srcpath(fs, path)) {
#ifdef HAVE_BTRFS_SUPPORT
- if (!strcmp(fs->fstype, "btrfs")) {
+ if (fs->fstype && !strcmp(fs->fstype, "btrfs")) {
uint64_t default_id = btrfs_get_default_subvol_id(mnt_fs_get_target(fs));
- uint64_t subvol_id;
char *val;
size_t len;
- if (default_id == UINT64_MAX) {
+ if (default_id == UINT64_MAX)
DBG(TAB, ul_debug("not found btrfs volume setting"));
- return fs;
- }
- if (mnt_fs_get_option(fs, "subvolid", &val, &len) == 0) {
+ else if (mnt_fs_get_option(fs, "subvolid", &val, &len) == 0) {
+ uint64_t subvol_id;
+
if (mnt_parse_offset(val, len, &subvol_id)) {
DBG(TAB, ul_debugobj(tb, "failed to parse subvolid="));
continue;