Red Hat Bugzilla – Bug 83627
nfsd calls iget without holding BKL?
Last modified: 2007-04-18 12:50:46 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2)
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):
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.
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
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()).
Created attachment 89898 [details]
Patch to nfsfh.c:find_fh_dentry
This patch adds lock_kernel/unlock_kernel around the first call to
Created attachment 89899 [details]
BUG() output from /var/log/messages
Please Upgrade to supported Release