btrfs-progs: provide fail safe for BTRFS_IOC_GET_FSLABEL ioctl
authorAnand Jain <anand.jain@oracle.com>
Tue, 15 Sep 2015 08:46:22 +0000 (16:46 +0800)
committerDavid Sterba <dsterba@suse.com>
Fri, 2 Oct 2015 15:52:10 +0000 (17:52 +0200)
commit94789777b9e8f350ba815b07baa5383e99cd1944
treec7874b6f83c52ecbac8dd8f9747004963004ae20
parent3276a9f519155486383e20958e0c5eb55d4c0b4f
btrfs-progs: provide fail safe for BTRFS_IOC_GET_FSLABEL ioctl

Old kernels before 3.9 do not provide ioctl BTRFS_IOC_GET_FSLABEL.
So we need to provide a fail safe logic for btrfs-progs running
on those kernel.

In this patch when get_label_mounted() fails on the old kernel
it will fail back to the old method and uses get_label_unmounted(),
where it will read from the disk directly.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-filesystem.c
utils.c
utils.h