Bug 83627 - nfsd calls iget without holding BKL?
nfsd calls iget without holding BKL?
Product: Red Hat Linux
Classification: Retired
Component: kernel (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Steve Dickson
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2003-02-06 09:39 EST by John Dalbec
Modified: 2007-04-18 12:50 EDT (History)
0 users

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

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

  None (edit)
Description John Dalbec 2003-02-06 09:39:09 EST
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 09:41:42 EST
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 09:43:14 EST
Created attachment 89899 [details]
BUG() output from /var/log/messages
Comment 3 Steve Dickson 2004-07-15 16:06:03 EDT
Please Upgrade to supported Release

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