Btrfs-progs: disable qgroup level 0 for userspace use
PATCH 2/4 Btrfs-progs: disable qgroup level 0 for userspace use
From: Wang Shilong <[email protected]>
To implement a strict hierarchy quota, qgroup level 0 should not be allowed to create/destroy by users.
Signed-off-by Wang Shilong <[email protected]>
--- cmds-qgroup.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
cmds-qgroup.c +5 -0
@@ -86,6 +86,11 @@ static int qgroup_create(int create, int argc, char **argv)memset (&args,0 ,sizeof (args)); args.create = create; args.qgroupid =parse_qgroupid (argv[1 ]); +if (!(args.qgroupid >>48 )) { +fprintf (stderr,"ERROR: unable to create/destroy qgroup " +"level 0\n" ); +return 30 ; + } fd =open_file_or_dir (path);if (fd <0 ) {
Signature · 1 line
1.7.7.6