From: Karel Zak Date: Tue, 28 Feb 2017 13:47:02 +0000 (+0100) Subject: libmount: cosmetic change to mnt_table_find_srcpath() X-Git-Tag: v2.30-rc1~203 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7bb9ee99da6558f75a1931bb95580124853f3e06;p=thirdparty%2Futil-linux.git libmount: cosmetic change to mnt_table_find_srcpath() Signed-off-by: Karel Zak --- diff --git a/libmount/src/tab.c b/libmount/src/tab.c index c86ff79511..10da730e3e 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;