b=13570
In filter_check_grant, for non_grant cache write, we should
check the left space by if (*left > ungranted + bytes), instead
of (*left > ungranted), because only we are sure the left space
is enough for another "bytes", then the ungrant space should be
increase. In client, we should update cl_avail_grant only there is
OBD_MD_FLGRANT in the reply.
i=adilger,green
Details : Add "-u" option for lustre_config script to support upgrading 1.4
server targets to 1.6 in parallel.
Details : Add "-u" option for lustre_config script to support upgrading 1.4
server targets to 1.6 in parallel.
+Severity : normal
+Bugzilla : 13570
+Description: grant fixes to avoid grant_space > avail_space
+Details : In filter_check_grant, for non_grant cache write, we should
+ check the left space by if (*left > ungranted + bytes), instead
+ of (*left > ungranted), because only we are sure the left space
+ is enough for another "bytes", then the ungrant space should be
+ increase. In client, we should update cl_avail_grant only there
+ is OBD_MD_FLGRANT in the reply.
+
--------------------------------------------------------------------------------
2007-08-10 Cluster File Systems, Inc. <info@clusterfs.com>
--------------------------------------------------------------------------------
2007-08-10 Cluster File Systems, Inc. <info@clusterfs.com>
- if (*left > ungranted) {
+ if (*left > ungranted + bytes) {
/* if enough space, pretend it was granted */
ungranted += bytes;
rnb[n].flags |= OBD_BRW_GRANTED;
/* if enough space, pretend it was granted */
ungranted += bytes;
rnb[n].flags |= OBD_BRW_GRANTED;
/* do not zero out oa->o_valid as it is used in filter_commitrw_write()
* for setting UID/GID and fid EA in first write time. */
/* do not zero out oa->o_valid as it is used in filter_commitrw_write()
* for setting UID/GID and fid EA in first write time. */
- if (oa->o_valid & OBD_MD_FLGRANT) {
+ if (oa->o_valid & OBD_MD_FLGRANT)
oa->o_grant = filter_grant(exp,oa->o_grant,oa->o_undirty,left);
oa->o_grant = filter_grant(exp,oa->o_grant,oa->o_undirty,left);
- oa->o_valid |= OBD_MD_FLGRANT;
- }
spin_unlock(&exp->exp_obd->obd_osfs_lock);
filter_fmd_put(exp, fmd);
spin_unlock(&exp->exp_obd->obd_osfs_lock);
filter_fmd_put(exp, fmd);
{
client_obd_list_lock(&cli->cl_loi_list_lock);
CDEBUG(D_CACHE, "got "LPU64" extra grant\n", body->oa.o_grant);
{
client_obd_list_lock(&cli->cl_loi_list_lock);
CDEBUG(D_CACHE, "got "LPU64" extra grant\n", body->oa.o_grant);
- cli->cl_avail_grant += body->oa.o_grant;
+ if (body->oa.o_valid & OBD_MD_FLGRANT)
+ cli->cl_avail_grant += body->oa.o_grant;
/* waiters are woken in brw_interpret_oap */
client_obd_list_unlock(&cli->cl_loi_list_lock);
}
/* waiters are woken in brw_interpret_oap */
client_obd_list_unlock(&cli->cl_loi_list_lock);
}