Btrfs: add sanity checks regarding to parsing mount options
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>
Wed, 24 Jul 2013 02:29:05 +0000 (10:29 +0800)
committerChris Mason <chris.mason@fusionio.com>
Sun, 1 Sep 2013 12:04:28 +0000 (08:04 -0400)
commit2c334e87f31783ca80b7ce265b25ba5489bfad1a
tree42f7ab57507b523ef3adb9a553a4612efa069673
parent3cd846d1d7640dd6b64d251cb9efd1a490d9a601
Btrfs: add sanity checks regarding to parsing mount options

I just notice the following commands succeed:
mount <dev> <mnt> -o thread_pool=-1

This is ridiculous, only positive thread_pool makes sense,this
patch adds sanity checks for them, and also catches the error of
ENOMEM if allocating memory fails.

Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Reviewed-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/super.c