[LU-3556] osd-ldiskfs module depends on mdd Created: 03/Jul/13  Updated: 10/Sep/13  Resolved: 10/Sep/13

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.4.1, Lustre 2.5.0
Fix Version/s: Lustre 2.5.0

Type: Bug Priority: Major
Reporter: Andreas Dilger Assignee: Dmitry Eremin (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-3105 remove unused code related to capabil... Resolved
Severity: 3
Rank (Obsolete): 8956

 Description   

It seems the osd-ldiskfs module depends on the mdd module because of the use of md_capainfo() in osd_object_auth() and osd_capa_get(). That causes a circular dependency on the modules and should be fixed. Problems are only avoided because the OSD module is loaded manually depending on OSD type.



 Comments   
Comment by Alex Zhuravlev [ 04/Jul/13 ]

probably http://review.whamcloud.com/#/c/5572/ could help?

Comment by Mikhail Pershin [ 04/Jul/13 ]

it should help, yes. Btw, what is the status of that patch? Is it going to be landed soon or is it low priority?

Comment by Andreas Dilger [ 04/Jul/13 ]

We discussed to remove capa code on OST, but also if it is useful for LFSCK like if parent FID is used as simple capa to deny clients to access to an object if they have the wrong parent.

Comment by Andreas Dilger [ 11/Jul/13 ]

For now, would it be easier to just move the tiny code fragment out of mdd_device.c:

/*
 * context key constructor/destructor:
 * mdd_capainfo_key_init, mdd_capainfo_key_fini
 */     
LU_KEY_INIT_FINI(mdd_capainfo, struct md_capainfo);

struct lu_context_key mdd_capainfo_key = {
        .lct_tags = LCT_SESSION,
        .lct_init = mdd_capainfo_key_init,
        .lct_fini = mdd_capainfo_key_fini
};

struct md_capainfo *md_capainfo(const struct lu_env *env)
{
        /* NB, in mdt_init0 */
        if (env->le_ses == NULL)
                return NULL;
        return lu_context_key_get(env->le_ses, &mdd_capainfo_key);
}
EXPORT_SYMBOL(md_capainfo);

int md_object.h, or some other public header?

Comment by Alex Zhuravlev [ 11/Jul/13 ]

I'm fine with that. as for capabilities.. I'm not sure we can easily use current infrastructure to do verification on OST because by design the checks are supposed to be done in OSD, but we need checks in OFD?

Comment by Andreas Dilger [ 11/Jul/13 ]

I've pushed http://review.whamcloud.com/6945:

LU-3566 osd-ldiskfs: remove dependency on mdd module
    
Move the lu_capainfo_get() function (formerly named md_capainfo())
into obdclass/capa.c instead of mdd_device.c.  Otherwise, the
osd-ldiskfs.ko module depends on mdd.ko in order to load, and that
doesn't really make sense.
    
Move the lu_capainfo structure (formerly named md_capainfo) into
lustre_capa.h, and change the structure field prefix to match the
new name.
    
Fix up the users of this structure/function, and do some code
style cleanup in those functions at the same time.

I don't really know much about this code, but it looks like there is a lot of simple cleanup that could be done:

  • rename BYPASS_CAPA to LC_BYPASS_CAPA to make it less generic for upstream submission
  • rename mdt_set_capainfo() to mdt_capainfo_set(), same for mdt_dump_capainfo()

It looks like md_capainfo was being accessed in the MDT, MDD, and OSD layers. I don't know if that is good or bad, just a bit unexpected.

Comment by Dmitry Eremin (Inactive) [ 13/Aug/13 ]

First part was landed to master. Do we need a code clean up?

Comment by Andreas Dilger [ 10/Sep/13 ]

Dependency on mdd has been removed from osd-ldiskfs module.

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