<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
Date: Mon, 19 Dec 2005 22:11:25 +0000 (-0500)
Subject: NLM: Fix Oops in nlmclnt_mark_reclaim()
X-Git-Tag: v2.6.15-rc7~13^2~10^2
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=9b5b1f5bf9dcdb6f23abf65977a675eb4deba3c0;hp=48e49187753ec3b4fa84a7165c9b7a59f3875b56

NLM: Fix Oops in nlmclnt_mark_reclaim()

 When mixing -olock and -onolock mounts on the same client, we have to
 check that fl-&gt;fl_u.nfs_fl.owner is set before dereferencing it.

 Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
---

--- linux-2.6.9/fs/lockd/clntlock.c.orig	2009-06-12 14:09:57.183141000 -0700
+++ linux-2.6.9/fs/lockd/clntlock.c	2009-06-12 14:11:43.067581000 -0700
@@ -166,6 +166,8 @@ void nlmclnt_mark_reclaim(struct nlm_hos
 		inode = fl-&gt;fl_file-&gt;f_dentry-&gt;d_inode;
 		if (inode-&gt;i_sb-&gt;s_magic != NFS_SUPER_MAGIC)
 			continue;
+		if (fl-&gt;fl_u.nfs_fl.owner == NULL)
+			continue;
 		if (fl-&gt;fl_u.nfs_fl.owner-&gt;host != host)
 			continue;
 		if (!(fl-&gt;fl_u.nfs_fl.flags &amp; NFS_LCK_GRANTED))
@@ -237,6 +239,8 @@ restart:
 		inode = fl-&gt;fl_file-&gt;f_dentry-&gt;d_inode;
 		if (inode-&gt;i_sb-&gt;s_magic != NFS_SUPER_MAGIC)
 			continue;
+		if (fl-&gt;fl_u.nfs_fl.owner == NULL)
+			continue;
 		if (fl-&gt;fl_u.nfs_fl.owner-&gt;host != host)
 			continue;
 		if (!(fl-&gt;fl_u.nfs_fl.flags &amp; NFS_LCK_RECLAIM))
</pre></body></html>