Skip to content

Commit 92655fb

Browse files
Alexander Aringteigland
authored andcommitted
fs: dlm: return positive pid value for F_GETLK
The GETLK pid values have all been negated since commit 9d5b86a ("fs/locks: Remove fl_nspid and use fs-specific l_pid for remote locks"). Revert this for local pids, and leave in place negative pids for remote owners. Cc: stable@vger.kernel.org Fixes: 9d5b86a ("fs/locks: Remove fl_nspid and use fs-specific l_pid for remote locks") Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
1 parent 35d6df5 commit 92655fb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

fs/dlm/plock.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,9 @@ int dlm_posix_get(dlm_lockspace_t *lockspace, u64 number, struct file *file,
360360
locks_init_lock(fl);
361361
fl->fl_type = (op->info.ex) ? F_WRLCK : F_RDLCK;
362362
fl->fl_flags = FL_POSIX;
363-
fl->fl_pid = -op->info.pid;
363+
fl->fl_pid = op->info.pid;
364+
if (op->info.nodeid != dlm_our_nodeid())
365+
fl->fl_pid = -fl->fl_pid;
364366
fl->fl_start = op->info.start;
365367
fl->fl_end = op->info.end;
366368
rv = 0;

0 commit comments

Comments
 (0)