Add check in tgt_grant_shrink() to protect ted_grant
against negative value.
Lustre-change: https://review.whamcloud.com/34996
Lustre-commit:
7e08317ef5cbed5cd587017cbe343eb4cc52822c
Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Change-Id: Iddea86f052124413ac60f5d0f26bcb68e376ede5
Reviewed-by: Quentin Bouget <quentin.bouget@cea.fr>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/35084
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
grant_shrink = oa->o_grant;
+ if (ted->ted_grant < grant_shrink) {
+ CDEBUG(D_CACHE,
+ "%s: cli %s/%p wants %lu shrinked > grant %lu\n",
+ obd->obd_name, exp->exp_client_uuid.uuid, exp,
+ grant_shrink, ted->ted_grant);
+ grant_shrink = ted->ted_grant;
+ }
+
ted->ted_grant -= grant_shrink;
tgd->tgd_tot_granted -= grant_shrink;