]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.8.8/gfs2-fix-unlock-of-fcntl-locks-during-withdrawn-state.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.8.8 / gfs2-fix-unlock-of-fcntl-locks-during-withdrawn-state.patch
CommitLineData
fc3fed8a
GKH
1From c2952d202f710d326ac36a8ea6bd216b20615ec8 Mon Sep 17 00:00:00 2001
2From: Steven Whitehouse <swhiteho@redhat.com>
3Date: Thu, 14 Mar 2013 15:49:59 +0000
4Subject: GFS2: Fix unlock of fcntl locks during withdrawn state
5
6From: Steven Whitehouse <swhiteho@redhat.com>
7
8commit c2952d202f710d326ac36a8ea6bd216b20615ec8 upstream.
9
10When withdraw occurs, we need to continue to allow unlocks of fcntl
11locks to occur, however these will only be local, since the node has
12withdrawn from the cluster. This prevents triggering a VFS level
13bug trap due to locks remaining when a file is closed.
14
15Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
16Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
17Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18
19---
20 fs/gfs2/file.c | 5 ++++-
21 1 file changed, 4 insertions(+), 1 deletion(-)
22
23--- a/fs/gfs2/file.c
24+++ b/fs/gfs2/file.c
25@@ -924,8 +924,11 @@ static int gfs2_lock(struct file *file,
26 cmd = F_SETLK;
27 fl->fl_type = F_UNLCK;
28 }
29- if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
30+ if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) {
31+ if (fl->fl_type == F_UNLCK)
32+ posix_lock_file_wait(file, fl);
33 return -EIO;
34+ }
35 if (IS_GETLK(cmd))
36 return dlm_posix_get(ls->ls_dlm, ip->i_no_addr, file, fl);
37 else if (fl->fl_type == F_UNLCK)