]> err.no Git - linux-2.6/commitdiff
NLM: Fix Oops in nlmclnt_mark_reclaim()
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 19 Dec 2005 22:11:25 +0000 (17:11 -0500)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 20 Dec 2005 04:12:31 +0000 (23:12 -0500)
 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>
fs/lockd/clntlock.c

index 006bb9e14579e42c37cd5954dac3a34b1eacf25c..3eaf6e70108781fec63c61a32141b435532faae3 100644 (file)
@@ -157,6 +157,8 @@ void nlmclnt_mark_reclaim(struct nlm_host *host)
                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))
@@ -226,6 +228,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))