that was implemented as tracking first and last lock of each lock group
the patch changes that to using doubly linked lists
+Severity : normal
+Bugzilla : 15933
+Description: delete compatibility for 32bit qdata
+Details : as planned, when lustre is beyond b1_8, lquota won't support for 32bit
+ qunit. That means servers of b1_4 and servers of b1_8 can't be used
+ together if users want to use quota.
+
-------------------------------------------------------------------------------
#define ECHO_CONNECT_SUPPORTED (0)
#define MGS_CONNECT_SUPPORTED (OBD_CONNECT_VERSION | OBD_CONNECT_AT)
-#define MAX_QUOTA_COUNT32 (0xffffffffULL)
-
#define OBD_OCD_VERSION(major,minor,patch,fix) (((major)<<24) + ((minor)<<16) +\
((patch)<<8) + (fix))
#define OBD_OCD_VERSION_MAJOR(version) ((int)((version)>>24)&255)
#warning "remove quota code above for format absolete in new release"
#endif
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(1, 7, 0, 0)
-struct qunit_data_old {
- __u32 qd_id; /* ID appiles to (uid, gid) */
- __u32 qd_type; /* Quota type (USRQUOTA, GRPQUOTA) */
- __u32 qd_count; /* acquire/release count (bytes for block quota) */
- __u32 qd_isblk; /* Block quota or file quota */
-};
-#else
-#warning "remove quota code above for format absolete in new release"
-#endif
-
extern void lustre_swab_qdata(struct qunit_data *d);
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(1, 7, 0, 0)
-extern void lustre_swab_qdata_old(struct qunit_data_old *d);
-#else
-#warning "remove quota code above for format absolete in new release"
-#endif
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(1, 9, 0, 0)
extern void lustre_swab_qdata_old2(struct qunit_data_old2 *d);
#else
#define OBD_FAIL_MGS_PAUSE_REQ 0x904
#define OBD_FAIL_MGS_PAUSE_TARGET_REG 0x905
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(1, 7, 0, 0)
-#define OBD_FAIL_QUOTA_QD_COUNT_32BIT 0xA00
-#else
-#warning "remove quota code above for format obsolete in new release"
-#endif
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(1, 9, 0, 0)
#define OBD_FAIL_QUOTA_WITHOUT_CHANGE_QS 0xA01
#else
__swab64s (&d->qd_qunit);
}
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(1, 7, 0, 0)
-void lustre_swab_qdata_old(struct qunit_data_old *d)
-{
- __swab32s (&d->qd_id);
- __swab32s (&d->qd_type);
- __swab32s (&d->qd_count);
- __swab32s (&d->qd_isblk);
-}
-#else
-#warning "remove quota code above for format absolete in new release"
-#endif
-
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(1, 9, 0, 0)
void lustre_swab_qdata_old2(struct qunit_data_old2 *d)
{
#ifdef __KERNEL__
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(1, 7, 0, 0)
-void qdata_v1_v3(struct qunit_data_old *d,
- struct qunit_data *qdata)
-{
- LASSERT(d);
- LASSERT(qdata);
-
- qdata->qd_id = d->qd_id;
- if (d->qd_type)
- QDATA_SET_GRP(qdata);
- if (d->qd_isblk)
- QDATA_SET_BLK(qdata);
- qdata->qd_count = d->qd_count;
-}
-
-struct qunit_data_old *qdata_v3_to_v1(struct qunit_data *d)
-{
- struct qunit_data tmp;
- struct qunit_data_old *ret;
- ENTRY;
-
- if (!d)
- return NULL;
-
- tmp = *d;
- ret = (struct qunit_data_old *)d;
- ret->qd_id = tmp.qd_id;
- ret->qd_type = (QDATA_IS_GRP(&tmp) ? GRPQUOTA : USRQUOTA);
- ret->qd_count = (__u32)tmp.qd_count;
- ret->qd_isblk = (QDATA_IS_BLK(&tmp) ? 1 : 0);
- RETURN(ret);
-}
-#else
-#warning "remove quota code above for format absolete in new release"
-#endif
-
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(1, 9, 0, 0)
void qdata_v2_to_v3(struct qunit_data_old2 *d,
struct qunit_data *qdata)
{
struct ptlrpc_request *req = (struct ptlrpc_request *)request;
struct qunit_data *new;
- struct qunit_data_old *old;
struct qunit_data_old2 *old2;
- int size = sizeof(struct qunit_data_old);
int size2 = sizeof(struct qunit_data_old2);
__u64 flags = is_exp ? req->rq_export->exp_connect_flags :
req->rq_import->imp_connect_data.ocd_connect_flags;
LASSERT(req);
LASSERT(qdata);
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(1, 7, 0, 0)
- if (OBD_FAIL_CHECK(OBD_FAIL_QUOTA_QD_COUNT_32BIT))
- goto quota32;
-#else
-#warning "remove quota code above for format absolete in new release"
-#endif
-
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(1, 9, 0, 0)
if (OBD_FAIL_CHECK(OBD_FAIL_QUOTA_WITHOUT_CHANGE_QS))
goto without_change_qs;
#warning "remove quota code above for format absolete in new release"
#endif
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(1, 7, 0, 0)
-quota32:
- /* not support for quota64 and change_qs */
- if (is_req == QUOTA_REQUEST)
- old = lustre_swab_reqbuf(req, REQ_REC_OFF, size,
- lustre_swab_qdata_old);
- else
- old = lustre_swab_repbuf(req, REPLY_REC_OFF, size,
- lustre_swab_qdata_old);
- qdata_v1_v3(old, qdata);
-#else
-#warning "remove quota code above for format absolete in new release"
-#endif
-
return 0;
}
EXPORT_SYMBOL(quota_get_qdata);
{
struct ptlrpc_request *req = (struct ptlrpc_request *)request;
void *target;
- struct qunit_data_old *old;
struct qunit_data_old2 *old2;
__u64 flags = is_exp ? req->rq_export->exp_connect_flags :
req->rq_import->imp_connect_data.ocd_connect_flags;
LASSERT(req);
LASSERT(qdata);
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(1, 7, 0, 0)
- if (OBD_FAIL_CHECK(OBD_FAIL_QUOTA_QD_COUNT_32BIT))
- goto quota32;
-#else
-#warning "remove quota code above for format absolete in new release"
-#endif
-
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(1, 9, 0, 0)
if (OBD_FAIL_CHECK(OBD_FAIL_QUOTA_WITHOUT_CHANGE_QS))
goto without_change_qs;
#warning "remove quota code above for format absolete in new release"
#endif
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(1, 7, 0, 0)
-quota32:
- /* not support for quota64 and change_qs */
- if (is_req == QUOTA_REQUEST)
- target = lustre_msg_buf(req->rq_reqmsg, REQ_REC_OFF,
- sizeof(struct qunit_data_old));
- else
- target = lustre_msg_buf(req->rq_repmsg, REPLY_REC_OFF,
- sizeof(struct qunit_data_old));
- if (!target)
- return -EINVAL;
- old = qdata_v3_to_v1(qdata);
- memcpy(target, old, sizeof(*old));
-#else
-#warning "remove quota code above for format absolete in new release"
-#endif
-
return 0;
}
EXPORT_SYMBOL(quota_copy_qdata);
{
int size;
- if (flag & OBD_CONNECT_CHANGE_QS) {
+ if (flag & OBD_CONNECT_CHANGE_QS)
size = sizeof(struct qunit_data);
- } else {
- /* write in this way because sizes of qunit_data_old and
- * qunit_data_old2 are same */
- LASSERT(sizeof(struct qunit_data_old) ==
- sizeof(struct qunit_data_old2));
- size = sizeof(struct qunit_data_old);
- }
+ else
+ size = sizeof(struct qunit_data_old2);
return(size);
}
EXPORT_SYMBOL(lustre_swab_ldlm_request);
EXPORT_SYMBOL(lustre_swab_ldlm_reply);
EXPORT_SYMBOL(lustre_swab_qdata);
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(1, 7, 0, 0)
-EXPORT_SYMBOL(lustre_swab_qdata_old);
-#else
-#warning "remove quota code above for format absolete in new release"
-#endif
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(1, 9, 0, 0)
EXPORT_SYMBOL(lustre_swab_qdata_old2);
#else
LASSERTF((int)sizeof(((struct qunit_data_old2 *)0)->qd_count) == 8, " found %lld\n",
(long long)(int)sizeof(((struct qunit_data_old2 *)0)->qd_count));
- /* Checks for struct qunit_data_old */
- LASSERTF((int)sizeof(struct qunit_data_old) == 16, " found %lld\n",
- (long long)(int)sizeof(struct qunit_data_old));
- LASSERTF((int)offsetof(struct qunit_data_old, qd_id) == 0, " found %lld\n",
- (long long)(int)offsetof(struct qunit_data_old, qd_id));
- LASSERTF((int)sizeof(((struct qunit_data_old *)0)->qd_id) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct qunit_data_old *)0)->qd_id));
- LASSERTF((int)offsetof(struct qunit_data_old, qd_type) == 4, " found %lld\n",
- (long long)(int)offsetof(struct qunit_data_old, qd_type));
- LASSERTF((int)sizeof(((struct qunit_data_old *)0)->qd_type) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct qunit_data_old *)0)->qd_type));
- LASSERTF((int)offsetof(struct qunit_data_old, qd_count) == 8, " found %lld\n",
- (long long)(int)offsetof(struct qunit_data_old, qd_count));
- LASSERTF((int)sizeof(((struct qunit_data_old *)0)->qd_count) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct qunit_data_old *)0)->qd_count));
- LASSERTF((int)offsetof(struct qunit_data_old, qd_isblk) == 12, " found %lld\n",
- (long long)(int)offsetof(struct qunit_data_old, qd_isblk));
- LASSERTF((int)sizeof(((struct qunit_data_old *)0)->qd_isblk) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct qunit_data_old *)0)->qd_isblk));
-
/* Checks for struct quota_adjust_qunit */
LASSERTF((int)sizeof(struct quota_adjust_qunit) == 32, " found %lld\n",
(long long)(int)sizeof(struct quota_adjust_qunit));
ENTRY;
LASSERT(imp);
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(1, 7, 0, 0)
- if (imp->imp_connect_data.ocd_connect_flags & OBD_CONNECT_QUOTA64 &&
- !OBD_FAIL_CHECK(OBD_FAIL_QUOTA_QD_COUNT_32BIT))
-#else
if (imp->imp_connect_data.ocd_connect_flags & OBD_CONNECT_QUOTA64)
-#endif
RETURN(0);
else
RETURN(1);
schedule_dqacq(struct obd_device *obd, struct lustre_quota_ctxt *qctxt,
struct qunit_data *qdata, int opc, int wait);
-static int split_before_schedule_dqacq(struct obd_device *obd,
- struct lustre_quota_ctxt *qctxt,
- struct qunit_data *qdata, int opc, int wait)
-{
- int rc = 0;
- unsigned long factor;
- struct qunit_data tmp_qdata;
- ENTRY;
-
- LASSERT(qdata && qdata->qd_count);
- QDATA_DEBUG(qdata, "%s quota split.\n",
- QDATA_IS_BLK(qdata) ? "block" : "inode");
- if (QDATA_IS_BLK(qdata))
- factor = MAX_QUOTA_COUNT32 / qctxt->lqc_bunit_sz *
- qctxt->lqc_bunit_sz;
- else
- factor = MAX_QUOTA_COUNT32 / qctxt->lqc_iunit_sz *
- qctxt->lqc_iunit_sz;
-
- if (qctxt->lqc_import && should_translate_quota(qctxt->lqc_import) &&
- qdata->qd_count > factor) {
- tmp_qdata = *qdata;
- tmp_qdata.qd_count = factor;
- qdata->qd_count -= tmp_qdata.qd_count;
- QDATA_DEBUG((&tmp_qdata), "be split.\n");
- rc = schedule_dqacq(obd, qctxt, &tmp_qdata, opc, wait);
- } else{
- QDATA_DEBUG(qdata, "don't be split.\n");
- rc = schedule_dqacq(obd, qctxt, qdata, opc, wait);
- }
-
- RETURN(rc);
-}
-
static int
dqacq_completion(struct obd_device *obd, struct lustre_quota_ctxt *qctxt,
struct qunit_data *qdata, int rc, int opc)
if (rc1 > 0) {
int opc;
opc = rc1 == 1 ? QUOTA_DQACQ : QUOTA_DQREL;
- rc1 = split_before_schedule_dqacq(obd, qctxt, qdata, opc, 0);
+ rc1 = schedule_dqacq(obd, qctxt, qdata, opc, 0);
QDATA_DEBUG(qdata, "reschedudle opc(%d) rc(%d)\n", opc, rc1);
}
RETURN(err);
struct dqacq_async_args *aa;
int size[2] = { sizeof(struct ptlrpc_body), 0 };
struct obd_import *imp = NULL;
- unsigned long factor;
struct lustre_qunit_size *lqs = NULL;
int rc = 0;
ENTRY;
RETURN(-ENOMEM);
}
- if (QDATA_IS_BLK(qdata))
- factor = MAX_QUOTA_COUNT32 / qctxt->lqc_bunit_sz *
- qctxt->lqc_bunit_sz;
- else
- factor = MAX_QUOTA_COUNT32 / qctxt->lqc_iunit_sz *
- qctxt->lqc_iunit_sz;
-
- LASSERTF(!should_translate_quota(imp) || qdata->qd_count <= factor,
- "qd_count: "LPU64"; should_translate_quota: %d.\n",
- qdata->qd_count, should_translate_quota(imp));
rc = quota_copy_qdata(req, qdata, QUOTA_REQUEST, QUOTA_IMPORT);
if (rc < 0) {
CDEBUG(D_ERROR, "Can't pack qunit_data\n");
ptlrpc_req_set_repsize(req, 2, size);
class_import_put(imp);
- if (wait && qunit)
+ if (wait && qunit)
qunit_get(qunit);
CLASSERT(sizeof(*aa) <= sizeof(req->rq_async_args));
int opc;
/* need acquire or release */
opc = ret == 1 ? QUOTA_DQACQ : QUOTA_DQREL;
- ret = split_before_schedule_dqacq(obd, qctxt, &qdata[i],
- opc, wait);
+ ret = schedule_dqacq(obd, qctxt, &qdata[i], opc, wait);
if (!rc)
rc = ret;
} else if (wait == 1) {
if (ret > 0) {
int opc;
opc = ret == 1 ? QUOTA_DQACQ : QUOTA_DQREL;
- rc = split_before_schedule_dqacq(obd, qctxt,
- &qdata, opc,
- 0);
+ rc = schedule_dqacq(obd, qctxt, &qdata, opc, 0);
if (rc == -EDQUOT)
rc = 0;
} else {
export PATH=$PWD/$SRCDIR:$SRCDIR:$PWD/$SRCDIR/../utils:$PATH:/sbin
ONLY=${ONLY:-"$*"}
-ALWAYS_EXCEPT="$SANITY_QUOTA_EXCEPT"
+ALWAYS_EXCEPT="10 $SANITY_QUOTA_EXCEPT"
# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
case `uname -r` in
}
static void
-check_qunit_data_old(void)
-{
- BLANK_LINE();
- CHECK_STRUCT(qunit_data_old);
- CHECK_MEMBER(qunit_data_old, qd_id);
- CHECK_MEMBER(qunit_data_old, qd_type);
- CHECK_MEMBER(qunit_data_old, qd_count);
- CHECK_MEMBER(qunit_data_old, qd_isblk);
-}
-
-static void
check_mgs_target_info(void)
{
BLANK_LINE();
LASSERTF((int)sizeof(((struct qunit_data_old2 *)0)->qd_count) == 8, " found %lld\n",
(long long)(int)sizeof(((struct qunit_data_old2 *)0)->qd_count));
- /* Checks for struct qunit_data_old */
- LASSERTF((int)sizeof(struct qunit_data_old) == 16, " found %lld\n",
- (long long)(int)sizeof(struct qunit_data_old));
- LASSERTF((int)offsetof(struct qunit_data_old, qd_id) == 0, " found %lld\n",
- (long long)(int)offsetof(struct qunit_data_old, qd_id));
- LASSERTF((int)sizeof(((struct qunit_data_old *)0)->qd_id) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct qunit_data_old *)0)->qd_id));
- LASSERTF((int)offsetof(struct qunit_data_old, qd_type) == 4, " found %lld\n",
- (long long)(int)offsetof(struct qunit_data_old, qd_type));
- LASSERTF((int)sizeof(((struct qunit_data_old *)0)->qd_type) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct qunit_data_old *)0)->qd_type));
- LASSERTF((int)offsetof(struct qunit_data_old, qd_count) == 8, " found %lld\n",
- (long long)(int)offsetof(struct qunit_data_old, qd_count));
- LASSERTF((int)sizeof(((struct qunit_data_old *)0)->qd_count) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct qunit_data_old *)0)->qd_count));
- LASSERTF((int)offsetof(struct qunit_data_old, qd_isblk) == 12, " found %lld\n",
- (long long)(int)offsetof(struct qunit_data_old, qd_isblk));
- LASSERTF((int)sizeof(((struct qunit_data_old *)0)->qd_isblk) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct qunit_data_old *)0)->qd_isblk));
-
/* Checks for struct quota_adjust_qunit */
LASSERTF((int)sizeof(struct quota_adjust_qunit) == 32, " found %lld\n",
(long long)(int)sizeof(struct quota_adjust_qunit));