static int osd_declare_attr_set(const struct lu_env *env,
....
#ifdef ZFS_PROJINHERIT
if (attr && attr->la_valid & LA_PROJID) {
if (attr->la_projid != obj->oo_attr.la_projid) {
if (!osd->od_projectused_dn)
GOTO(out, rc = -EOPNOTSUPP);
/* Usually, if project quota is upgradable for the
* device, then the upgrade will be done before or when
* mount the device. So when we come here, this project
* should have project ID attribute already (that is
* zero by default). Otherwise, there was something
* wrong during the former upgrade, let's return failure
* to report that.
*
* Please note that, different from other attributes,
* you can NOT simply set the project ID attribute under
* such case, because adding (NOT change) project ID
* attribute needs to change the object's attribute
* layout to match zfs backend quota accounting
* requirement. */
if (unlikely(!obj->oo_with_projid))
GOTO(out, rc = -ENXIO);
rc = qsd_transfer(env, osd_def_qsd(osd),
&oh->ot_quota_trans, PRJQUOTA,
obj->oo_attr.la_projid,
attr->la_projid, bspace,
&info->oti_qi, true);
if (rc)
GOTO(out, rc);
}
}
#endif
....
static int __osd_object_attr_get(const struct lu_env *env, struct osd_device *o,
....
#ifdef ZFS_PROJINHERIT
if (o->od_projectused_dn && osa->flags & ZFS_PROJID) {
rc = -sa_lookup(obj->oo_sa_hdl, SA_ZPL_PROJID(o),
&osa->projid, 8);
if (rc)
GOTO(out_sa, rc);
la->la_projid = osa->projid;
la->la_valid |= LA_PROJID;
obj->oo_with_projid = 1;
} else {
la->la_projid = ZFS_DEFAULT_PROJID;
la->la_valid &= ~LA_PROJID;
}
#else
The patch for https://jira.whamcloud.com/browse/LU-13189 is solving this issue as well.