Bug 235648 - does nlm_lookup_host lose hosts in hash table?
does nlm_lookup_host lose hosts in hash table?
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Layton
Martin Jenner
Depends On:
Blocks: 242221
  Show dependency treegraph
Reported: 2007-04-08 23:18 EDT by wengang wang
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-06-18 07:21:52 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
test program (1.29 KB, text/plain)
2007-06-04 09:04 EDT, Jeff Layton
no flags Details

  None (edit)
Description wengang wang 2007-04-08 23:18:00 EDT
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 10:37:48 EDT
Reassigning to kernel component.

Read ya, Phil
Comment 2 Jeff Layton 2007-06-04 09:04:15 EDT
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 09:07:29 EDT
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 07:21:52 EDT
No response from reporter for 2 weeks. Closing as NOTABUG. Please reopen if you
believe this conclusion is incorrect.

Note You need to log in before you can comment on or make changes to this bug.