]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.fixes/NFSv4-Fix-an-Oops-in-nfs4_free_lock_state.patch
Reenabled linux-xen, added patches for Xen Kernel Version 2.6.27.31,
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.fixes / NFSv4-Fix-an-Oops-in-nfs4_free_lock_state.patch
1 Patch-mainline: 2.6.31
2 From: b64aec8d1e1d8482a7b6cca60c8105c756bf1fe4 Mon Sep 17 00:00:00 2001
3 From: Trond Myklebust <Trond.Myklebust@netapp.com>
4 Date: Tue, 21 Jul 2009 16:47:46 -0400
5 Subject: [PATCH] NFSv4: Fix an Oops in nfs4_free_lock_state
6
7 The oops http://www.kerneloops.org/raw.php?rawid=537858&msgid= appears to
8 be due to the nfs4_lock_state->ls_state field being uninitialised. This
9 happens if the call to nfs4_free_lock_state() is triggered at the end of
10 nfs4_get_lock_state().
11
12 The fix is to move the initialisation of ls_state into the allocator.
13
14 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
15 Acked-by: NeilBrown <neilb@suse.de>
16
17 ---
18 fs/nfs/nfs4state.c | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21 --- linux-2.6.27-SLE11_BRANCH.orig/fs/nfs/nfs4state.c
22 +++ linux-2.6.27-SLE11_BRANCH/fs/nfs/nfs4state.c
23 @@ -545,6 +545,7 @@ static struct nfs4_lock_state *nfs4_allo
24 INIT_LIST_HEAD(&lsp->ls_sequence.list);
25 lsp->ls_seqid.sequence = &lsp->ls_sequence;
26 atomic_set(&lsp->ls_count, 1);
27 + lsp->ls_state = state;
28 lsp->ls_owner = fl_owner;
29 spin_lock(&clp->cl_lock);
30 nfs_alloc_unique_id(&clp->cl_lockowner_id, &lsp->ls_id, 1, 64);
31 @@ -580,7 +581,6 @@ static struct nfs4_lock_state *nfs4_get_
32 if (lsp != NULL)
33 break;
34 if (new != NULL) {
35 - new->ls_state = state;
36 list_add(&new->ls_locks, &state->lock_states);
37 set_bit(LK_STATE_IN_USE, &state->flags);
38 lsp = new;