Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-8895 target: limit grant allocation
[fs/lustre-release.git]
/
lustre
/
target
/
tgt_grant.c
diff --git
a/lustre/target/tgt_grant.c
b/lustre/target/tgt_grant.c
index
4fa0623
..
355a092
100644
(file)
--- a/
lustre/target/tgt_grant.c
+++ b/
lustre/target/tgt_grant.c
@@
-931,6
+931,14
@@
static long tgt_grant_alloc(struct obd_export *exp, u64 curgrant,
if ((grant > chunk) && conservative)
grant = chunk;
if ((grant > chunk) && conservative)
grant = chunk;
+ /*
+ * Limit grant so that export' grant does not exceed what the
+ * client would like to have by more than grants for 2 full
+ * RPCs
+ */
+ if (ted->ted_grant + grant > want + chunk)
+ grant = want + chunk - ted->ted_grant;
+
tgd->tgd_tot_granted += grant;
ted->ted_grant += grant;
tgd->tgd_tot_granted += grant;
ted->ted_grant += grant;