OSDN Git Service

btrfs: prevent to set invalid default subvolid
authorsatoru takeuchi <satoru.takeuchi@gmail.com>
Tue, 12 Sep 2017 13:42:52 +0000 (22:42 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Oct 2017 07:41:47 +0000 (09:41 +0200)
commit4c16afac1875db0ad251b1df0e12203302528fcb
treed6384e63d8c82ca7275f0014958488421dcb1634
parent0efde43517a54007c4b19a72d9e3da8a0199074e
btrfs: prevent to set invalid default subvolid

commit 6d6d282932d1a609e60dc4467677e0e863682f57 upstream.

`btrfs sub set-default` succeeds to set an ID which isn't corresponding to any
fs/file tree. If such the bad ID is set to a filesystem, we can't mount this
filesystem without specifying `subvol` or `subvolid` mount options.

Fixes: 6ef5ed0d386b ("Btrfs: add ioctl and incompat flag to set the default mount subvol")
Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
Reviewed-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/ioctl.c