]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/suse-2.6.27.25/patches.fixes/nfs-lock-release-lockargs
Updated xen patches taken from suse.
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.fixes / nfs-lock-release-lockargs
1 From: Felix Blyakher <felixb@sgi.com>
2 Patch-mainline: queued for 2.6.31
3 References: bnc#501651
4 Date: Tue, 31 Mar 2009 20:12:56 +0000 (-0500)
5 Subject: lockd: call locks_release_private to cleanup per-filesystem state
6 X-Git-Url: http://git.linux-nfs.org/?p=bfields%2Flinux.git;a=commitdiff_plain;h=a9e61e25f9d2e7e43bf17625f5cb56c9e0a89b17
7
8 lockd: call locks_release_private to cleanup per-filesystem state
9
10 For every lock request lockd creates a new file_lock object
11 in nlmsvc_setgrantargs() by copying the passed in file_lock with
12 locks_copy_lock(). A filesystem can attach it's own lock_operations
13 vector to the file_lock. It has to be cleaned up at the end of the
14 file_lock's life. However, lockd doesn't do it today, yet it
15 asserts in nlmclnt_release_lockargs() that the per-filesystem
16 state is clean.
17 This patch fixes it by exporting locks_release_private() and adding
18 it to nlmsvc_freegrantargs(), to be symmetrical to creating a
19 file_lock in nlmsvc_setgrantargs().
20
21 Signed-off-by: Felix Blyakher <felixb@sgi.com>
22
23 Acked-by: NeilBrown <neilb@suse.de>
24
25 ---
26 fs/lockd/svclock.c | 2 ++
27 fs/locks.c | 3 ++-
28 include/linux/fs.h | 1 +
29 3 files changed, 5 insertions(+), 1 deletion(-)
30
31 --- linux-2.6.27-SLE11_BRANCH.orig/fs/lockd/svclock.c
32 +++ linux-2.6.27-SLE11_BRANCH/fs/lockd/svclock.c
33 @@ -326,6 +326,8 @@ static void nlmsvc_freegrantargs(struct
34 {
35 if (call->a_args.lock.oh.data != call->a_owner)
36 kfree(call->a_args.lock.oh.data);
37 +
38 + locks_release_private(&call->a_args.lock.fl);
39 }
40
41 /*
42 --- linux-2.6.27-SLE11_BRANCH.orig/fs/locks.c
43 +++ linux-2.6.27-SLE11_BRANCH/fs/locks.c
44 @@ -151,7 +151,7 @@ static struct file_lock *locks_alloc_loc
45 return kmem_cache_alloc(filelock_cache, GFP_KERNEL);
46 }
47
48 -static void locks_release_private(struct file_lock *fl)
49 +void locks_release_private(struct file_lock *fl)
50 {
51 if (fl->fl_ops) {
52 if (fl->fl_ops->fl_release_private)
53 @@ -165,6 +165,7 @@ static void locks_release_private(struct
54 }
55
56 }
57 +EXPORT_SYMBOL_GPL(locks_release_private);
58
59 /* Free a lock which is not in use. */
60 static void locks_free_lock(struct file_lock *fl)
61 --- linux-2.6.27-SLE11_BRANCH.orig/include/linux/fs.h
62 +++ linux-2.6.27-SLE11_BRANCH/include/linux/fs.h
63 @@ -1015,6 +1015,7 @@ extern void locks_copy_lock(struct file_
64 extern void __locks_copy_lock(struct file_lock *, const struct file_lock *);
65 extern void locks_remove_posix(struct file *, fl_owner_t);
66 extern void locks_remove_flock(struct file *);
67 +extern void locks_release_private(struct file_lock *);
68 extern void posix_test_lock(struct file *, struct file_lock *);
69 extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *);
70 extern int posix_lock_file_wait(struct file *, struct file_lock *);