Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 235648

Summary: does nlm_lookup_host lose hosts in hash table?
Product: Red Hat Enterprise Linux 5 Reporter: wengang wang <wangwengang1976>
Component: kernelAssignee: Jeff Layton <jlayton>
Status: CLOSED NOTABUG QA Contact: Martin Jenner <mjenner>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.0CC: staubach, steved
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-06-18 11:21:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 242221    
Attachments:
Description Flags
test program none

Description wengang wang 2007-04-09 03:18:00 UTC
for function nlm_lookup_host in fs/lockd/host.c,
when the host found is not the head in the bucket in the hash table, it will be
moved to head. source is like this,
---------------------
  if (hp != nlm_hosts + hash) {
                                *hp = host->h_next;
                                host->h_next = nlm_hosts[hash];
                                nlm_hosts[hash] = host;
                        }
--------------------------
won't it lose hosts that are originally between the one to search for and the
original head? for *hp is not handled after *hp = host->h_next;

this problem covers rhel4 and rhel5.  
i think it fixed in kernel 2.6.20.

Comment 1 Phil Knirsch 2007-05-24 14:37:48 UTC
Reassigning to kernel component.

Read ya, Phil

Comment 2 Jeff Layton 2007-06-04 13:04:15 UTC
Created attachment 156070 [details]
test program

Wow, for only being 4-5 important lines this is hard to figure out. It looks
like upstream moved all of this to hlist routines, which is good, but I don't
think we can do that in RHEL5 w/o breaking kABI.

After staring at this for ~ an hour and playing with stuff on paper, I gave up
and wrote a test program to see whether this was broken. I think it's
equivalent to what the kernel code does.

Testing this empirically shows that this code works as expected. When it finds
a match, it moves it to the top of the list and everything else is still linked
into the list.

I'm thinking this is NOTABUG, but I certainly wouldn't mind someone double
checking me on this.

Comment 3 Jeff Layton 2007-06-04 13:07:29 UTC
Setting to NEEDINFO reporter...

Could you sanity check my test program and make sure that I'm not missing
something? If it looks OK, then I'd suggest we close this as NOTABUG.


Comment 4 Jeff Layton 2007-06-18 11:21:52 UTC
No response from reporter for 2 weeks. Closing as NOTABUG. Please reopen if you
believe this conclusion is incorrect.