[LU-6128] LNet: Problem handling error when lnet_check_routes() fail. Created: 15/Jan/15  Updated: 23/Jan/15  Resolved: 23/Jan/15

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

Type: Bug Priority: Critical
Reporter: Amir Shehata (Inactive) Assignee: Amir Shehata (Inactive)
Resolution: Fixed Votes: 0
Labels: HB

Severity: 3
Rank (Obsolete): 17068

 Description   

In LNetCtl():

                LNET_MUTEX_LOCK(&the_lnet.ln_api_mutex);
                rc = lnet_add_route(config->cfg_net,
                                    config->cfg_config_u.cfg_route.rtr_hop,
                                    config->cfg_nid,
                                    config->cfg_config_u.cfg_route.
                                        rtr_priority);
                LNET_MUTEX_UNLOCK(&the_lnet.ln_api_mutex);
                return (rc != 0) ? rc : lnet_check_routes();

If lnet_check_routes() returns error, it means the route just added was invalid and must be removed, see LNetNIInit(). It's wrong to just return the error to user space:
1. User space would treat the error as a failure to add the route, but the route was indeed added already.
2. Two conflicting routes now live in the routing table.



 Comments   
Comment by Isaac Huang (Inactive) [ 16/Jan/15 ]

I think the correct action would be to remove the route just added and return the error from lnet_check_routes().

Comment by Gerrit Updater [ 16/Jan/15 ]

Amir Shehata (amir.shehata@intel.com) uploaded a new patch: http://review.whamcloud.com/13445
Subject: LU-6128 lnet: handle lnet_check_routes() errors
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: f628bdd8d240b135c92996a910ba200e0c7279e1

Comment by Gerrit Updater [ 23/Jan/15 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/13445/
Subject: LU-6128 lnet: handle lnet_check_routes() errors
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: b53998fdcc70c2f58bf436c318a0165f0f5ce224

Comment by Peter Jones [ 23/Jan/15 ]

Landed for 2.7

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