]> git.baikalelectronics.ru Git - kernel.git/commit
lockd: Fix invalid lockowner cast after vfs_test_lock
authorBenjamin Coddington <bcodding@redhat.com>
Mon, 26 Jul 2021 13:33:28 +0000 (09:33 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Tue, 17 Aug 2021 15:47:52 +0000 (11:47 -0400)
commit0e19e16d73b12c7cefff6610293b6638db18c30c
treee67924a0a136ac10dc690da48f17df50af2e6f32
parentdf65d5a854c2835fb4a8bdd1e1f1a8cb67b14b25
lockd: Fix invalid lockowner cast after vfs_test_lock

After calling vfs_test_lock() the pointer to a conflicting lock can be
returned, and that lock is not guarunteed to be owned by nlm.  In that
case, we cannot cast it to struct nlm_lockowner.  Instead return the pid
of that conflicting lock.

Fixes: 69d9f09b2a94 ("lockd: Show pid of lockd for remote locks")
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/lockd/svclock.c