[LU-6514] redundant rc check in lprocfs_client_fid_width_seq_write Created: 27/Apr/15  Updated: 07/Jul/15  Resolved: 07/Jul/15

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

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

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

There is a bit of strange code in lprocfs_client_fid_width_seq_write():

        rc = lprocfs_write_helper(buffer, count, &val);
        if (rc) {
                mutex_unlock(&seq->lcs_mutex);
                RETURN(rc);
        }

        if (seq->lcs_type == LUSTRE_SEQ_DATA)
                max = LUSTRE_DATA_SEQ_MAX_WIDTH;
        else
                max = LUSTRE_METADATA_SEQ_MAX_WIDTH;

        if (val <= max && val > 0) {
                seq->lcs_width = val;

                if (rc == 0) {
                        CDEBUG(D_INFO, "%s: Sequence size: "LPU64"\n",
                               seq->lcs_name, seq->lcs_width);
                }
        }

note that the last rc ==0 is always true, but it's also somewhat misleadign in that the thinking goes that we can be there with rc !=0, but would still set the setting, just not print the message which is total nonsense.



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

Oleg Drokin (oleg.drokin@intel.com) uploaded a new patch: http://review.whamcloud.com/14604
Subject: LU-6514 fid: remove misleading rc check in lprocfs_client_fid_width_seq_write
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: cc84cea5cffa40b37459429697c808137d9a5899

Comment by Gerrit Updater [ 24/Jun/15 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/14604/
Subject: LU-6514 fid: remove misleading rc check in lprocfs_client_fid_width_seq_write
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 07660179a32649e54228da26e34674f48318cbd7

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