[LU-7120] [style][uselessAssignmentPtrArg] Assignment of function parameter has no effect outside the function. Created: 09/Sep/15  Updated: 16/Nov/15  Resolved: 16/Nov/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: Ashish Purkar Assignee: nasf (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Environment:

any


Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

File:lustre-wc-rel/lustre/osd-ldiskfs/osd_scrub.c
Line:785

static void osd_scrub_post(struct osd_scrub *scrub, int result)
{
        struct scrub_file *sf = &scrub->os_file;
        ENTRY;

        CDEBUG(D_LFSCK, "%.16s: OI scrub post, result = %d\n",
               osd_scrub2name(scrub), result);
.
.
.
        sf->sf_run_time += cfs_duration_sec(cfs_time_current() + HALF_SEC -
                                            scrub->os_time_last_checkpoint);
        result = osd_scrub_file_store(scrub); <--- Assignment of function parameter has no effect outside the function.
        up_write(&scrub->os_rwsem);

        EXIT;
}

Called from:

static int osd_scrub_main(void *args)
{
        struct lu_env         env;
        struct osd_device    *dev    = (struct osd_device *)args;
        struct osd_scrub     *scrub  = &dev->od_scrub;
        struct ptlrpc_thread *thread = &scrub->os_thread;
        int                   rc;
        ENTRY;
.
.
.
post:
        osd_scrub_post(scrub, rc); <--- Called from here
        CDEBUG(D_LFSCK, "%.16s: OI scrub: stop, pos = %u: rc = %d\n",
               osd_scrub2name(scrub), scrub->os_pos_current, rc);

out:
        while (!list_empty(&scrub->os_inconsistent_items)) {
                struct osd_inconsistent_item *oii;

                oii = list_entry(scrub->os_inconsistent_items.next,
                                     struct osd_inconsistent_item, oii_list);
                list_del_init(&oii->oii_list);
                OBD_FREE_PTR(oii);
        }
        lu_env_fini(&env);

noenv:
        spin_lock(&scrub->os_lock);
        thread_set_flags(thread, SVC_STOPPED);
        wake_up_all(&thread->t_ctl_waitq);
        spin_unlock(&scrub->os_lock);
        return rc;
}


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

Fan Yong

Could you please look into this?

Thanks

Peter

Comment by Gerrit Updater [ 11/Sep/15 ]

Fan Yong (fan.yong@intel.com) uploaded a new patch: http://review.whamcloud.com/16368
Subject: LU-7120 scrub: handle osd_scrub_post return value
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: d1591a3ba47d6d873730faf85654f3ddfa5345ff

Comment by Gerrit Updater [ 13/Nov/15 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/16368/
Subject: LU-7120 scrub: handle osd_scrub_post return value
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 2057592b01a4751d3e6c25f5604a288d37981857

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