]>
Commit | Line | Data |
---|---|---|
fc3fed8a GKH |
1 | From c2952d202f710d326ac36a8ea6bd216b20615ec8 Mon Sep 17 00:00:00 2001 |
2 | From: Steven Whitehouse <swhiteho@redhat.com> | |
3 | Date: Thu, 14 Mar 2013 15:49:59 +0000 | |
4 | Subject: GFS2: Fix unlock of fcntl locks during withdrawn state | |
5 | ||
6 | From: Steven Whitehouse <swhiteho@redhat.com> | |
7 | ||
8 | commit c2952d202f710d326ac36a8ea6bd216b20615ec8 upstream. | |
9 | ||
10 | When withdraw occurs, we need to continue to allow unlocks of fcntl | |
11 | locks to occur, however these will only be local, since the node has | |
12 | withdrawn from the cluster. This prevents triggering a VFS level | |
13 | bug trap due to locks remaining when a file is closed. | |
14 | ||
15 | Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> | |
16 | Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com> | |
17 | Signed-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) |