i=di.wang
i=oleg.drokin
- filter_preprw_write() should check for OBD_FL_SHRINK_GRANT in o_flags instead
of o_valid;
- The grant shrink code should not use o_flags w/o setting OBD_MD_FLFLAGS since
o_flags can be legitimately reset if OBD_MD_FLFLAGS (e.g. it is done in the
checksum code);
- OBD_FL_MMAP is added to wiretest & wirecheck
fed->fed_grant -= oa->o_dropped;
fed->fed_dirty = oa->o_dirty;
fed->fed_grant -= oa->o_dropped;
fed->fed_dirty = oa->o_dirty;
- if (oa->o_flags & OBD_FL_SHRINK_GRANT) {
+ if (oa->o_valid & OBD_MD_FLFLAGS && oa->o_flags & OBD_FL_SHRINK_GRANT) {
obd_size left_space = filter_grant_space_left(exp);
struct filter_obd *filter = &exp->exp_obd->u.filter;
obd_size left_space = filter_grant_space_left(exp);
struct filter_obd *filter = &exp->exp_obd->u.filter;
cfs_spin_lock(&obd->obd_osfs_lock);
filter_grant_incoming(exp, oa);
cfs_spin_lock(&obd->obd_osfs_lock);
filter_grant_incoming(exp, oa);
- if (!(oa->o_flags & OBD_FL_SHRINK_GRANT))
+ if (!(oa->o_valid & OBD_MD_FLFLAGS) ||
+ !(oa->o_flags & OBD_FL_SHRINK_GRANT))
oa->o_grant = 0;
cfs_spin_unlock(&obd->obd_osfs_lock);
}
oa->o_grant = 0;
cfs_spin_unlock(&obd->obd_osfs_lock);
}
* so no sense in allocating it some more. We either return the grant
* back to the client if we have plenty of space or we don't return
* anything if we are short. This was decided in filter_grant_incoming*/
* so no sense in allocating it some more. We either return the grant
* back to the client if we have plenty of space or we don't return
* anything if we are short. This was decided in filter_grant_incoming*/
- if (oa->o_valid & OBD_MD_FLGRANT &&!(oa->o_valid & OBD_FL_SHRINK_GRANT))
+ if ((oa->o_valid & OBD_MD_FLGRANT) &&
+ (!(oa->o_valid & OBD_MD_FLFLAGS) ||
+ !(oa->o_flags & OBD_FL_SHRINK_GRANT)))
oa->o_grant = filter_grant(exp, oa->o_grant, oa->o_undirty,
left, 1);
oa->o_grant = filter_grant(exp, oa->o_grant, oa->o_undirty,
left, 1);
oa->o_grant = cli->cl_avail_grant / 4;
cli->cl_avail_grant -= oa->o_grant;
client_obd_list_unlock(&cli->cl_loi_list_lock);
oa->o_grant = cli->cl_avail_grant / 4;
cli->cl_avail_grant -= oa->o_grant;
client_obd_list_unlock(&cli->cl_loi_list_lock);
+ if (!(oa->o_valid & OBD_MD_FLFLAGS)) {
+ oa->o_valid |= OBD_MD_FLFLAGS;
+ oa->o_flags = 0;
+ }
oa->o_flags |= OBD_FL_SHRINK_GRANT;
osc_update_next_shrink(cli);
}
oa->o_flags |= OBD_FL_SHRINK_GRANT;
osc_update_next_shrink(cli);
}
body->oa.o_grant = cli->cl_avail_grant - target;
cli->cl_avail_grant = target;
client_obd_list_unlock(&cli->cl_loi_list_lock);
body->oa.o_grant = cli->cl_avail_grant - target;
cli->cl_avail_grant = target;
client_obd_list_unlock(&cli->cl_loi_list_lock);
+ if (!(body->oa.o_valid & OBD_MD_FLFLAGS)) {
+ body->oa.o_valid |= OBD_MD_FLFLAGS;
+ body->oa.o_flags = 0;
+ }
body->oa.o_flags |= OBD_FL_SHRINK_GRANT;
osc_update_next_shrink(cli);
body->oa.o_flags |= OBD_FL_SHRINK_GRANT;
osc_update_next_shrink(cli);
CLASSERT(OBD_FL_CKSUM_CRC32 == 4096);
CLASSERT(OBD_FL_CKSUM_ADLER == 8192);
CLASSERT(OBD_FL_SHRINK_GRANT == 131072);
CLASSERT(OBD_FL_CKSUM_CRC32 == 4096);
CLASSERT(OBD_FL_CKSUM_ADLER == 8192);
CLASSERT(OBD_FL_SHRINK_GRANT == 131072);
+ CLASSERT(OBD_FL_MMAP == (0x00040000));
CLASSERT(OBD_CKSUM_CRC32 == 1);
CLASSERT(OBD_CKSUM_ADLER == 2);
CLASSERT(OBD_CKSUM_CRC32 == 1);
CLASSERT(OBD_CKSUM_ADLER == 2);
CHECK_CVALUE(OBD_FL_CKSUM_CRC32);
CHECK_CVALUE(OBD_FL_CKSUM_ADLER);
CHECK_CVALUE(OBD_FL_SHRINK_GRANT);
CHECK_CVALUE(OBD_FL_CKSUM_CRC32);
CHECK_CVALUE(OBD_FL_CKSUM_ADLER);
CHECK_CVALUE(OBD_FL_SHRINK_GRANT);
+ CHECK_CDEFINE(OBD_FL_MMAP);
CHECK_CVALUE(OBD_CKSUM_CRC32);
CHECK_CVALUE(OBD_CKSUM_ADLER);
}
CHECK_CVALUE(OBD_CKSUM_CRC32);
CHECK_CVALUE(OBD_CKSUM_ADLER);
}
CLASSERT(OBD_FL_CKSUM_CRC32 == 4096);
CLASSERT(OBD_FL_CKSUM_ADLER == 8192);
CLASSERT(OBD_FL_SHRINK_GRANT == 131072);
CLASSERT(OBD_FL_CKSUM_CRC32 == 4096);
CLASSERT(OBD_FL_CKSUM_ADLER == 8192);
CLASSERT(OBD_FL_SHRINK_GRANT == 131072);
+ CLASSERT(OBD_FL_MMAP == (0x00040000));
CLASSERT(OBD_CKSUM_CRC32 == 1);
CLASSERT(OBD_CKSUM_ADLER == 2);
CLASSERT(OBD_CKSUM_CRC32 == 1);
CLASSERT(OBD_CKSUM_ADLER == 2);