Re: [PATCH v2 1/1] libmount: return tab entry for default node

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 23, 2017 at 07:25:13PM +0100, Petr Vorel wrote:
>  libmount/src/tab.c | 29 ++++++++++++++++++++++++++++-
>  1 file changed, 28 insertions(+), 1 deletion(-)

Applied, thanks.

    Karel

> +#ifdef HAVE_BTRFS_SUPPORT
> +			if (!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) {
> +					DBG(TAB, ul_debug("not found btrfs volume setting"));
> +					return fs;
> +				}

I have added

                else if (mnt_fs_get_option...

to avoid the "return fs"

> +
> +				if (mnt_fs_get_option(fs, "subvolid", &val, &len) == 0) {
> +					if (mnt_parse_offset(val, len, &subvol_id)) {
> +						DBG(TAB, ul_debugobj(tb, "failed to parse subvolid="));
> +						continue;
> +					}
> +					if (subvol_id != default_id)
> +						continue;
> +				}
> +			}
> +#endif /* HAVE_BTRFS_SUPPORT */
>  			return fs;
> +		}
>  		if (mnt_fs_get_tag(fs, NULL, NULL) == 0)
>  			ntags++;
>  	}
> -- 
> 2.11.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe util-linux" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux