btrfs-progs: qgroup limit: error out if input value is negative
commitd9fd7cc0f554b88a8c878a36ed096347c98bba7f
authorDongsheng Yang <yangds.fnst@cn.fujitsu.com>
Wed, 3 Jun 2015 09:27:03 +0000 (3 17:27 +0800)
committerDavid Sterba <dsterba@suse.cz>
Fri, 5 Jun 2015 16:40:32 +0000 (5 18:40 +0200)
tree1222a9d0aa8b65ea0f7e833b38fe70021fbf857d
parentea496435d5f9eb97681bcd69ff012917b2a3b201
btrfs-progs: qgroup limit: error out if input value is negative

If we pass a negative value to command qgroup limit, btrfs-progs
would convert it to unsigned long long silently. That's a little
confusing to user, why I can limit my quota to a negative value.

This patch add a check in parse_limit, if the input value is negative,
error out to user.

Reported-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
cmds-qgroup.c