[LU-6479] sub object held by master object will stop it to be released Created: 21/Apr/15  Updated: 22/Sep/15  Resolved: 17/Sep/15

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

Type: Bug Priority: Minor
Reporter: Di Wang Assignee: Di Wang
Resolution: Not a Bug Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Sub stripe object will be holded by master object until the master object is freed. (lod_object_free()->lod_object_free_striping()

void lod_object_free_striping(const struct lu_env *env, struct lod_object *lo)
{
        int i; 
         
        if (lo->ldo_dir_stripe != NULL) {
                OBD_FREE_PTR(lo->ldo_dir_stripe);
                lo->ldo_dir_stripe = NULL;
        }
        
        if (lo->ldo_stripe) {
                LASSERT(lo->ldo_stripes_allocated > 0);

                for (i = 0; i < lo->ldo_stripenr; i++) {
                        if (lo->ldo_stripe[i])
                                lu_object_put(env, &lo->ldo_stripe[i]->do_lu);
                }

                i = sizeof(struct dt_object *) * lo->ldo_stripes_allocated;
                OBD_FREE(lo->ldo_stripe, i);
                lo->ldo_stripe = NULL;
                lo->ldo_stripes_allocated = 0;
        }
        ............

So the master object (of striped directory) should be freed immediately once the ref count reach to 0.



 Comments   
Comment by Gerrit Updater [ 21/Apr/15 ]

wangdi (di.wang@intel.com) uploaded a new patch: http://review.whamcloud.com/14511
Subject: LU-6479 lod: free the striped object immediately
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 22872cf7b6d776e2ae7e5115e5588fb47b868055

Comment by Andreas Dilger [ 17/Sep/15 ]

Any update on this bug and related patch? Is this needed for proper functionality in 2.8.0 or is it just a code cleanup? What causes this bug to be hit and what is the impact (e.g. hit during normal usage and LBUG, or hit during racer and MDS can't be shut down cleanly at the end)?

Comment by Di Wang [ 17/Sep/15 ]

Hmm, had a few discussion with Alex about this. And probably we should just close the ticket for now, since there are no good reason to release the sub object when destroy the master object. And the original problem I met because of this seems gone in my new test. So let's close this one for now. And if it is necessary, I will reopen the ticket with better reason.

Comment by Alex Zhuravlev [ 18/Sep/15 ]

I think it'd be good to keep around as a possible enhancement at least. there are few reasons for that:
1) OSP objects aren't needed most of time (only at create/unlink/chown), so currently we just waste memory
2) there is an issue with declared striping changing from declare to execution - to work this around we had to introduce additional locking in MDD (or MDT, don't remember exactly). now, with lod_thandle declare can prepare striping for its own use and don't race with other threads. I find this very important.

Comment by Andreas Dilger [ 22/Sep/15 ]

Alex, should this ticket be reopened to track the issues you described? Otherwise they will be lost.

Generated at Sat Feb 10 02:00:35 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.