diff options
author | David Teigland <teigland@redhat.com> | 2007-06-08 18:01:40 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2007-07-09 03:23:33 -0400 |
commit | a7a2ff8a951ab373732116e7c31e2e1fe025d5e0 (patch) | |
tree | aec05033231051f07af384f2e89dd500ff3d7a66 /fs | |
parent | d88101d4d82ea09433692af30618c3b7afb7da02 (diff) |
[GFS2] return conflicts for GETLK
We weren't returning the correct result when GETLK found a conflict,
which is indicated by userspace passing back a 1.
Signed-off-by: Abhijith Das <adas redhat com>
Signed-off-by: David Teigland <teigland redhat com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/gfs2/locking/dlm/plock.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/gfs2/locking/dlm/plock.c b/fs/gfs2/locking/dlm/plock.c index 1dc76805dd45..fba1f1d87e4f 100644 --- a/fs/gfs2/locking/dlm/plock.c +++ b/fs/gfs2/locking/dlm/plock.c | |||
@@ -254,16 +254,20 @@ int gdlm_plock_get(void *lockspace, struct lm_lockname *name, | |||
254 | } | 254 | } |
255 | spin_unlock(&ops_lock); | 255 | spin_unlock(&ops_lock); |
256 | 256 | ||
257 | /* info.rv from userspace is 1 for conflict, 0 for no-conflict, | ||
258 | -ENOENT if there are no locks on the file */ | ||
259 | |||
257 | rv = op->info.rv; | 260 | rv = op->info.rv; |
258 | 261 | ||
259 | fl->fl_type = F_UNLCK; | 262 | fl->fl_type = F_UNLCK; |
260 | if (rv == -ENOENT) | 263 | if (rv == -ENOENT) |
261 | rv = 0; | 264 | rv = 0; |
262 | else if (rv == 0 && op->info.pid != fl->fl_pid) { | 265 | else if (rv > 0) { |
263 | fl->fl_type = (op->info.ex) ? F_WRLCK : F_RDLCK; | 266 | fl->fl_type = (op->info.ex) ? F_WRLCK : F_RDLCK; |
264 | fl->fl_pid = op->info.pid; | 267 | fl->fl_pid = op->info.pid; |
265 | fl->fl_start = op->info.start; | 268 | fl->fl_start = op->info.start; |
266 | fl->fl_end = op->info.end; | 269 | fl->fl_end = op->info.end; |
270 | rv = 0; | ||
267 | } | 271 | } |
268 | 272 | ||
269 | kfree(op); | 273 | kfree(op); |