[LU-6509] dead code in nodemap_create Created: 27/Apr/15  Updated: 27/Apr/15

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

Type: Bug Priority: Minor
Reporter: Oleg Drokin Assignee: WC Triage
Resolution: Unresolved Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Highlighted by smatch in nodemap_create:

...
        rc = nm_member_init_hash(nodemap);
        if (rc != 0) {
                OBD_FREE_PTR(nodemap);
                goto out;
        }
... (not touching rc at all)
        if (rc == 0) {
                nodemap_putref(nodemap);
                goto out;
        }

        CERROR("cannot add nodemap: '%s': rc = %d\n", name, rc);
        nodemap_destroy(nodemap);

out:
        return rc;

I wonder if this is a stub waiting for some more code or something was forgotten or what?



 Comments   
Comment by Oleg Drokin [ 27/Apr/15 ]

Also in lprocfs_add_nodemap_range_seq_write:

        rc = nodemap_add_range(name, nids);
        if (rc != 0)
                GOTO(out, rc = -EINVAL);

        if (rc == 0)
                rc = count;

out:
        return rc;

Why do we need that last "if" again?

Comment by Oleg Drokin [ 27/Apr/15 ]

and the same in lprocfs_add_nodemap_idmap_seq_write and lprocfs_del_nodemap_idmap_seq_write

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