[LU-6524] llog_osd_destroy incorrectly tried to use ERR_PTR pointer Created: 27/Apr/15  Updated: 10/Jun/15  Resolved: 10/Jun/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: easy, patch

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

smatch highlighted tihs obviously incorrect code in llog_osd_destroy:

        if (loghandle->lgh_name) {
                llog_dir = llog_osd_dir_get(env, ctxt);
                if (IS_ERR(llog_dir))
                        GOTO(out_trans, rc = PTR_ERR(llog_dir));
...
out_trans:
        dt_trans_stop(env, d, th);
        if (llog_dir != NULL)
                lu_object_put(env, &llog_dir->do_lu);

Nothing good can come out of it for sure.



 Comments   
Comment by Ulka Vaze (Inactive) [ 19/May/15 ]

Yes This needs to be changed.
I will push below change -
if (loghandle->lgh_name) {
llog_dir = llog_osd_dir_get(env, ctxt);
if (IS_ERR(llog_dir))
GOTO(out_trans, rc = -ENOENT);

-Ulka

Comment by Gerrit Updater [ 20/May/15 ]

Ulka Vaze (ulka.vaze@yahoo.in) uploaded a new patch: http://review.whamcloud.com/14876
Subject: LU-6524 llog: Incorrect use of ERR_PTR
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 3dabf9e8b1c4f5833f06741d8871b438c0a9f4cb

Comment by Gerrit Updater [ 28/May/15 ]

Ulka Vaze (ulka.vaze@yahoo.in) uploaded a new patch: http://review.whamcloud.com/14986
Subject: LU-6524 llog: Incorrect use of ERR_PTR
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: fd837e6261026d87cbe8d93ac9d33dba7a28d069

Comment by Gerrit Updater [ 10/Jun/15 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/14876/
Subject: LU-6524 llog: Incorrect use of ERR_PTR
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 6c1f7d3177057f91ece1a6ee02753d6b40024268

Comment by Peter Jones [ 10/Jun/15 ]

Landed for 2.8

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