From: Trond Myklebust <Trond.Myklebust@netapp.com>
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->fl_u.nfs_fl.owner is set before dereferencing it.

 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
---

--- 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->fl_file->f_dentry->d_inode;
 		if (inode->i_sb->s_magic != NFS_SUPER_MAGIC)
 			continue;
+		if (fl->fl_u.nfs_fl.owner == NULL)
+			continue;
 		if (fl->fl_u.nfs_fl.owner->host != host)
 			continue;
 		if (!(fl->fl_u.nfs_fl.flags & NFS_LCK_GRANTED))
@@ -237,6 +239,8 @@ restart:
 		inode = fl->fl_file->f_dentry->d_inode;
 		if (inode->i_sb->s_magic != NFS_SUPER_MAGIC)
 			continue;
+		if (fl->fl_u.nfs_fl.owner == NULL)
+			continue;
 		if (fl->fl_u.nfs_fl.owner->host != host)
 			continue;
 		if (!(fl->fl_u.nfs_fl.flags & NFS_LCK_RECLAIM))
