[LU-15509] Ping buffer reference leaks in lnet_peer_data_present() Created: 01/Feb/22  Updated: 15/Jun/22  Resolved: 11/Jun/22

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

Type: Bug Priority: Minor
Reporter: Chris Horn Assignee: Chris Horn
Resolution: Fixed Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

There are some additional places where ping buffer reference will leak in lnet_peer_data_present(). These are error paths so they should be rare.

static int lnet_peer_data_present(struct lnet_peer *lp)
__must_hold(&lp->lp_lock)
{
...
        if (list_empty(&lp->lp_peer_list))
                goto out; <<< Ref leak
...
        if (nid_is_lo0(&lp->lp_primary_nid)) {
                rc = lnet_peer_set_primary_nid(lp, nid, flags);
                if (!rc) <<< ref leak if rc is non-zero
                        rc = lnet_peer_merge_data(lp, pbuf);
...
                if (!lpni || lp == lpni->lpni_peer_net->lpn_peer) {
                        rc = lnet_peer_set_primary_nid(lp, nid, flags);
                        if (rc) { 
                                CERROR("Primary NID error %s versus %s: %d\n",
                                       libcfs_nidstr(&lp->lp_primary_nid),
                                       libcfs_nid2str(nid), rc);   <<< ref leak
                        } else {
                                rc = lnet_peer_merge_data(lp, pbuf);
                        }
...


 Comments   
Comment by Gerrit Updater [ 02/Feb/22 ]

"Chris Horn <chris.horn@hpe.com>" uploaded a new patch: https://review.whamcloud.com/46431
Subject: LU-15509 lnet: Ping buffer ref leak in lnet_peer_data_present
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 8e361c9faf8cf819a1339e9e8afccfeacdeaf3ab

Comment by Gerrit Updater [ 11/Jun/22 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/46431/
Subject: LU-15509 lnet: Ping buffer ref leak in lnet_peer_data_present
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 4de9793654ec1b2f08d93f74f7391c4245ab8769

Comment by Peter Jones [ 11/Jun/22 ]

Landed for 2.16

Comment by Gerrit Updater [ 13/Jun/22 ]

"Olaf Faaland-LLNL <faaland1@llnl.gov>" uploaded a new patch: https://review.whamcloud.com/47613
Subject: LU-15509 lnet: Ping buffer ref leak in lnet_peer_data_present
Project: fs/lustre-release
Branch: b2_15
Current Patch Set: 1
Commit: 69668d7d6e8f4f3c63fe0f369ca9de9b905c9b80

Comment by Olaf Faaland [ 13/Jun/22 ]

Seems like this should be landed to 2.15 as well, at some point, so I pushed a backport.  Should this issue get label "LTS15"?

Comment by Gerrit Updater [ 15/Jun/22 ]

"Olaf Faaland-LLNL <faaland1@llnl.gov>" uploaded a new patch: https://review.whamcloud.com/47639
Subject: LU-15509 lnet: Ping buffer ref leak in lnet_peer_data_present
Project: fs/lustre-release
Branch: b2_12
Current Patch Set: 1
Commit: 15972bb6c5e2bdcc39ad7ca4796ffe5c6e5f3726

Generated at Sat Feb 10 03:18:55 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.