[LU-4911] Using wrong attr inside mdd_is_subdir Created: 15/Apr/14  Updated: 09/Oct/21  Resolved: 09/Oct/21

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

Type: Bug Priority: Minor
Reporter: Di Wang Assignee: WC Triage
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Related
is related to LU-11104 rename under striped directory may ca... Resolved
Severity: 3
Rank (Obsolete): 13555

 Description   

in mdd_is_subdir, it keeps using the same attr for all parents lookup,

static int mdd_is_parent(const struct lu_env *env,
                        struct mdd_device *mdd,
                        struct mdd_object *p1,
                        const struct lu_attr *attr,
                        const struct lu_fid *lf,
                        struct lu_fid *pf)
{
......


        for(;;) {
                /* this is done recursively, bypass capa for each obj */
                mdd_set_capainfo(env, 4, p1, BYPASS_CAPA);
                rc = mdd_parent_fid(env, p1, attr, pfid);
                .....

                p1 = parent;  <-----  p1 is changed to its parent, we should retrieve new attr here.
                 
        }

}



 Comments   
Comment by Andreas Dilger [ 15/Apr/14 ]

Di, how critical is this issue? Does it need to be a blocker for 2.6.0? Does it mean the remote directories are not working correctly?

Comment by Di Wang [ 15/Apr/14 ]

oh, not critical, probably not serious enough to become a blocker. I just found this issue, when I inspect #9538, I guess it might cause some security issue, since we use the attr to do permission check here. But the fix should be easy IMHO, just add another attr_get before call mdd_parent_fid.

Comment by Andreas Dilger [ 09/Oct/21 ]

Fixed via LU-11104

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