Bug 83627 - nfsd calls iget without holding BKL?
Summary: nfsd calls iget without holding BKL?
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: kernel
Version: 7.1
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: Steve Dickson
QA Contact: Brian Brock
Depends On:
TreeView+ depends on / blocked
Reported: 2003-02-06 14:39 UTC by John Dalbec
Modified: 2007-04-18 16:50 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2004-07-15 20:06:03 UTC

Attachments (Terms of Use)
Patch to nfsfh.c:find_fh_dentry (406 bytes, patch)
2003-02-06 14:41 UTC, John Dalbec
no flags Details | Diff
BUG() output from /var/log/messages (11.22 KB, text/plain)
2003-02-06 14:43 UTC, John Dalbec
no flags Details

Description John Dalbec 2003-02-06 14:39:09 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2)
Gecko/20021120 Netscape/7.01

Description of problem:
If the NFS server is running a kernel patched with Chris Mason's (@SuSE.com)
ReiserFS data-logging patches and sharing a ReiserFS filesystem, rebooting the
server while clients have outstanding reads/writes causes a BUG().  According to
Chris Mason, the BUG() indicates that even the unpatched kernel is not holding
the BKL when it should.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Patch kernel with data-logging patches.
2. Install patched SMP kernel on NFS server.
3. Share ReiserFS filesystem from NFS server.
4. Start processes reading/writing this filesystem on the NFS client(s).
5. Reboot NFS server.

Actual Results:  Server knfsd processes and client processes hang.

Expected Results:  The knfsd processes should resume NFS service normally.

Additional info:

Chris Mason writes:
> Traditionally, the BKL is supposed to be held when iget or iget4 is
> called.  RedHat might have patches that do away with that and simply
> missed reiserfs, but it is more likely they have a patch to reduce 
> BKL use in NFS that missed the iget4 case.
> So your two basic choices are adding the BKL to reiserfs_read_inode2, 
> or going into the nfsd source and putting them around the iget4 call.

> Even though the check is only introduced in the data logging code, 
> the non-data logging code needs the BKL in search_by_key all the 
> time.

The find_fh_dentry code calls nfsd_get_dentry twice.  In the second call the BKL
is held; so it seems to me that the Right Way(TM) to fix this is to lock the
kernel during the first call as well.  I'll attach a patch.

You may, of course, disagree and prefer to patch reiserfs_read_inode2 to hold
the BKL during search_item() (which is #define'd as search_by_key()).

Comment 1 John Dalbec 2003-02-06 14:41:42 UTC
Created attachment 89898 [details]
Patch to nfsfh.c:find_fh_dentry

This patch adds lock_kernel/unlock_kernel around the first call to

Comment 2 John Dalbec 2003-02-06 14:43:14 UTC
Created attachment 89899 [details]
BUG() output from /var/log/messages

Comment 3 Steve Dickson 2004-07-15 20:06:03 UTC
Please Upgrade to supported Release

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