[LU-5980] Eliminate old quota formats Created: 03/Dec/14  Updated: 11/Aug/15  Resolved: 11/Aug/15

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.8.0
Fix Version/s: Lustre 2.8.0

Type: Bug Priority: Minor
Reporter: James Nunez (Inactive) Assignee: Niu Yawei (Inactive)
Resolution: Duplicate Votes: 0
Labels: quota

Issue Links:
Related
is related to LU-6617 Remove quota migration code Resolved
is related to LU-1842 Quota enforcement landing Resolved
Severity: 3
Rank (Obsolete): 16693

 Description   

From comment in Lustre code,

we use different index feature for each quota type and target type for the time being. This is done for on-disk conversion from the old quota format. Once this is no longer required, we should just be using dt_quota_glb_features for all global index file

In Lustre 2.8, tag 2.7.53 and above, the code for the on-disk conversion of the old quota format is no longer used, due to LUSTRE_VERSION_CODE, and the conversion is no longer supported. If we want to continue to support the old format, the following code should be modified else it should be removed.

In lustre/quota/lquota_disk.c, routine lquota_disk_glb_find_create(),

#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 53, 0)
	/* we use different index feature for each quota type and target type
	 * for the time being. This is done for on-disk conversion from the old
	 * quota format. Once this is no longer required, we should just be
	 * using dt_quota_glb_features for all global index file */
	idx_feat = glb_idx_feature(fid);
#else
	idx_feat = &dt_quota_glb_features;
#endif

In lustre/quota/lquota_lib.c, glb_idx_features() and associated structs are no longer defined/supported.

#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 53, 0)
/* Index features supported by the global index objects.
 * We actually use one dt_index_features structure for each quota combination
 * of quota type x [inode, block] to allow the ldiskfs OSD to recognize those
 * objects and to handle the conversion from the old administrative quota file
 * format */
struct dt_index_features dt_quota_iusr_features;
EXPORT_SYMBOL(dt_quota_iusr_features);
struct dt_index_features dt_quota_busr_features;
EXPORT_SYMBOL(dt_quota_busr_features);
struct dt_index_features dt_quota_igrp_features;
EXPORT_SYMBOL(dt_quota_igrp_features);
struct dt_index_features dt_quota_bgrp_features;
EXPORT_SYMBOL(dt_quota_bgrp_features);

/**
 * Helper routine returning the right index feature structure to be used
 * depending on the FID of the global index.
 */
const struct dt_index_features *glb_idx_feature(struct lu_fid *fid)
{
	int	res_type, quota_type, rc;

	rc = lquota_extract_fid(fid, NULL, &res_type, &quota_type);
	if (rc)
		return ERR_PTR(rc);

	if (quota_type == USRQUOTA) {
		if (res_type == LQUOTA_RES_MD)
			return &dt_quota_iusr_features;
		else
			return &dt_quota_busr_features;
	} else {
		if (res_type == LQUOTA_RES_MD)
			return &dt_quota_igrp_features;
		else
			return &dt_quota_bgrp_features;
	}
}
#endif /* LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 53, 0) */

and in init_lquota():

#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 53, 0)
	dt_quota_iusr_features = dt_quota_busr_features = dt_quota_glb_features;
	dt_quota_igrp_features = dt_quota_bgrp_features = dt_quota_glb_features;
#endif


 Comments   
Comment by Peter Jones [ 10/Aug/15 ]

Niu

Did this get handled under LU-6617?

Peter

Comment by Niu Yawei (Inactive) [ 11/Aug/15 ]

Right, this was fixed in LU-6617.

Generated at Sat Feb 10 01:56:10 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.