Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 235648 - does nlm_lookup_host lose hosts in hash table?
Summary: does nlm_lookup_host lose hosts in hash table?
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel
Version: 5.0
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: Jeff Layton
QA Contact: Martin Jenner
Depends On:
Blocks: 242221
TreeView+ depends on / blocked
Reported: 2007-04-09 03:18 UTC by wengang wang
Modified: 2007-11-30 22:07 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2007-06-18 11:21:52 UTC
Target Upstream Version:

Attachments (Terms of Use)
test program (deleted)
2007-06-04 13:04 UTC, Jeff Layton
no flags Details

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.

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