LU-14740 llite: avoid project quota overflow
Currently, project ID is stored as u32, max possible
value for it is
4294967295.
However, VFS reserve max value for special usage, see
following function:
static inline bool
qid_has_mapping(struct user_namespace *ns, struct kqid qid)
{
return from_kqid(ns, qid) != (qid_t) -1;
}
So qid_has_mapping() could return 0 for id
4294967295.
A further try on chown test:
$ chown
4294967295:
4294967295 c.sh
chown: invalid user: ‘
4294967295:
4294967295’
$ chown
4294967294:
4294967294 c.sh
Fix to check max possible value for project ID in the
client kernel side, and add a test case for this.
Test-parameters: trivial testlist=sanity-quota
Fixes:
7b5c1f1404c3 ("LU-13845 utils: Quota id 0xFFFFFFFF is invalid")
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Change-Id: Ide8b9cc79d9b7f2a8b9860a0c0f683ec903b8f91
Reviewed-on: https://review.whamcloud.com/43939
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>