<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/dlm/plock.c, branch linux-6.5.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.5.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.5.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2023-09-13T07:53:54Z</updated>
<entry>
<title>dlm: fix plock lookup when using multiple lockspaces</title>
<updated>2023-09-13T07:53:54Z</updated>
<author>
<name>Alexander Aring</name>
</author>
<published>2023-08-24T20:51:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=999436d17b4928ca21f67a86afa5f0fe6e816d8a'/>
<id>urn:sha1:999436d17b4928ca21f67a86afa5f0fe6e816d8a</id>
<content type='text'>
commit 7c53e847ff5e97f033fdd31f71949807633d506b upstream.

All posix lock ops, for all lockspaces (gfs2 file systems) are
sent to userspace (dlm_controld) through a single misc device.
The dlm_controld daemon reads the ops from the misc device
and sends them to other cluster nodes using separate, per-lockspace
cluster api communication channels.  The ops for a single lockspace
are ordered at this level, so that the results are received in
the same sequence that the requests were sent.  When the results
are sent back to the kernel via the misc device, they are again
funneled through the single misc device for all lockspaces.  When
the dlm code in the kernel processes the results from the misc
device, these results will be returned in the same sequence that
the requests were sent, on a per-lockspace basis.  A recent change
in this request/reply matching code missed the "per-lockspace"
check (fsid comparison) when matching request and reply, so replies
could be incorrectly matched to requests from other lockspaces.

Cc: stable@vger.kernel.org
Reported-by: Barry Marson &lt;bmarson@redhat.com&gt;
Fixes: 57e2c2f2d94c ("fs: dlm: fix mismatch of plock results from userspace")
Signed-off-by: Alexander Aring &lt;aahringo@redhat.com&gt;
Signed-off-by: David Teigland &lt;teigland@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>fs: dlm: fix mismatch of plock results from userspace</title>
<updated>2023-05-24T19:27:07Z</updated>
<author>
<name>Alexander Aring</name>
</author>
<published>2023-05-24T16:02:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=57e2c2f2d94cfd551af91cedfa1af6d972487197'/>
<id>urn:sha1:57e2c2f2d94cfd551af91cedfa1af6d972487197</id>
<content type='text'>
When a waiting plock request (F_SETLKW) is sent to userspace
for processing (dlm_controld), the result is returned at a
later time. That result could be incorrectly matched to a
different waiting request in cases where the owner field is
the same (e.g. different threads in a process.) This is fixed
by comparing all the properties in the request and reply.

The results for non-waiting plock requests are now matched
based on list order because the results are returned in the
same order they were sent.

Cc: stable@vger.kernel.org
Signed-off-by: Alexander Aring &lt;aahringo@redhat.com&gt;
Signed-off-by: David Teigland &lt;teigland@redhat.com&gt;
</content>
</entry>
<entry>
<title>fs: dlm: make F_SETLK use unkillable wait_event</title>
<updated>2023-05-23T17:56:58Z</updated>
<author>
<name>Alexander Aring</name>
</author>
<published>2023-05-19T15:21:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0f2b1cb89ccdbdcedf7143f4153a4da700a05f48'/>
<id>urn:sha1:0f2b1cb89ccdbdcedf7143f4153a4da700a05f48</id>
<content type='text'>
While a non-waiting posix lock request (F_SETLK) is waiting for
user space processing (in dlm_controld), wait for that processing
to complete with an unkillable wait_event(). This makes F_SETLK
behave the same way for F_RDLCK, F_WRLCK and F_UNLCK. F_SETLKW
continues to use wait_event_killable().

Cc: stable@vger.kernel.org
Signed-off-by: Alexander Aring &lt;aahringo@redhat.com&gt;
Signed-off-by: David Teigland &lt;teigland@redhat.com&gt;
</content>
</entry>
<entry>
<title>fs: dlm: interrupt posix locks only when process is killed</title>
<updated>2023-05-22T19:34:32Z</updated>
<author>
<name>Alexander Aring</name>
</author>
<published>2023-05-19T15:21:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=59e45c758ca1b9893ac923dd63536da946ac333b'/>
<id>urn:sha1:59e45c758ca1b9893ac923dd63536da946ac333b</id>
<content type='text'>
If a posix lock request is waiting for a result from user space
(dlm_controld), do not let it be interrupted unless the process
is killed. This reverts commit a6b1533e9a57 ("dlm: make posix locks
interruptible"). The problem with the interruptible change is
that all locks were cleared on any signal interrupt. If a signal
was received that did not terminate the process, the process
could continue running after all its dlm posix locks had been
cleared. A future patch will add cancelation to allow proper
interruption.

Cc: stable@vger.kernel.org
Fixes: a6b1533e9a57 ("dlm: make posix locks interruptible")
Signed-off-by: Alexander Aring &lt;aahringo@redhat.com&gt;
Signed-off-by: David Teigland &lt;teigland@redhat.com&gt;
</content>
</entry>
<entry>
<title>fs: dlm: fix cleanup pending ops when interrupted</title>
<updated>2023-05-22T18:49:55Z</updated>
<author>
<name>Alexander Aring</name>
</author>
<published>2023-05-19T15:21:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c847f4e203046a2c93d8a1cf0348315c0b655a60'/>
<id>urn:sha1:c847f4e203046a2c93d8a1cf0348315c0b655a60</id>
<content type='text'>
Immediately clean up a posix lock request if it is interrupted
while waiting for a result from user space (dlm_controld.)  This
largely reverts the recent commit b92a4e3f86b1 ("fs: dlm: change
posix lock sigint handling"). That previous commit attempted
to defer lock cleanup to the point in time when a result from
user space arrived. The deferred approach was not reliable
because some dlm plock ops may not receive replies.

Cc: stable@vger.kernel.org
Fixes: b92a4e3f86b1 ("fs: dlm: change posix lock sigint handling")
Signed-off-by: Alexander Aring &lt;aahringo@redhat.com&gt;
Signed-off-by: David Teigland &lt;teigland@redhat.com&gt;
</content>
</entry>
<entry>
<title>fs: dlm: return positive pid value for F_GETLK</title>
<updated>2023-05-22T18:34:47Z</updated>
<author>
<name>Alexander Aring</name>
</author>
<published>2023-05-19T15:21:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=92655fbda5c05950a411eaabc19e025e86e2a291'/>
<id>urn:sha1:92655fbda5c05950a411eaabc19e025e86e2a291</id>
<content type='text'>
The GETLK pid values have all been negated since commit 9d5b86ac13c5
("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: 9d5b86ac13c5 ("fs/locks: Remove fl_nspid and use fs-specific l_pid for remote locks")
Signed-off-by: Alexander Aring &lt;aahringo@redhat.com&gt;
Signed-off-by: David Teigland &lt;teigland@redhat.com&gt;
</content>
</entry>
<entry>
<title>filelock: move file locking definitions to separate header file</title>
<updated>2023-01-11T11:52:32Z</updated>
<author>
<name>Jeff Layton</name>
</author>
<published>2022-11-20T14:15:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5970e15dbcfeb0ed3a0bf1954f35bbe60a048754'/>
<id>urn:sha1:5970e15dbcfeb0ed3a0bf1954f35bbe60a048754</id>
<content type='text'>
The file locking definitions have lived in fs.h since the dawn of time,
but they are only used by a small subset of the source files that
include it.

Move the file locking definitions to a new header file, and add the
appropriate #include directives to the source files that need them. By
doing this we trim down fs.h a bit and limit the amount of rebuilding
that has to be done when we make changes to the file locking APIs.

Reviewed-by: Xiubo Li &lt;xiubli@redhat.com&gt;
Reviewed-by: Christian Brauner (Microsoft) &lt;brauner@kernel.org&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: David Howells &lt;dhowells@redhat.com&gt;
Reviewed-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Acked-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Acked-by: Joseph Qi &lt;joseph.qi@linux.alibaba.com&gt;
Acked-by: Steve French &lt;stfrench@microsoft.com&gt;
Acked-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Acked-by: Darrick J. Wong &lt;djwong@kernel.org&gt;
Signed-off-by: Jeff Layton &lt;jlayton@kernel.org&gt;
</content>
</entry>
<entry>
<title>fs: dlm: change posix lock sigint handling</title>
<updated>2022-06-24T16:53:05Z</updated>
<author>
<name>Alexander Aring</name>
</author>
<published>2022-06-22T18:45:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b92a4e3f86b1a1d0b001ec832ddc96195e3edf31'/>
<id>urn:sha1:b92a4e3f86b1a1d0b001ec832ddc96195e3edf31</id>
<content type='text'>
This patch changes the handling of a plock operation that was interrupted
while waiting for a user space reply from dlm_controld.  (This is not
the lock blocking state, i.e. locks_lock_file_wait().)

Currently, when an op is interrupted while waiting on user space, the
op is removed.  When the user space result later arrives, a kernel
message is loggged: "dev_write no op...".  This can be seen from a test
such as "stress-ng --fcntl 100" and interrupting it with ctrl-c.

Now, leave the op in place when interrupted and remove it when the
result arrives (the result will be ignored.)  With this change, the
logged message is not expected to appear, and would indicate a bug.

Signed-off-by: Alexander Aring &lt;aahringo@redhat.com&gt;
Signed-off-by: David Teigland &lt;teigland@redhat.com&gt;
</content>
</entry>
<entry>
<title>fs: dlm: use dlm_plock_info for do_unlock_close</title>
<updated>2022-06-24T16:53:04Z</updated>
<author>
<name>Alexander Aring</name>
</author>
<published>2022-06-22T18:45:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4d413ae9ced4180c0e2114553c3a7560b509b0f8'/>
<id>urn:sha1:4d413ae9ced4180c0e2114553c3a7560b509b0f8</id>
<content type='text'>
This patch refactors do_unlock_close() by using only struct dlm_plock_info
as a parameter.

Signed-off-by: Alexander Aring &lt;aahringo@redhat.com&gt;
Signed-off-by: David Teigland &lt;teigland@redhat.com&gt;
</content>
</entry>
<entry>
<title>fs: dlm: change plock interrupted message to debug again</title>
<updated>2022-06-24T16:52:36Z</updated>
<author>
<name>Alexander Aring</name>
</author>
<published>2022-06-22T18:45:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ea06d4cabf529eefbe7e89e3a8325f1f89355ccd'/>
<id>urn:sha1:ea06d4cabf529eefbe7e89e3a8325f1f89355ccd</id>
<content type='text'>
This patch reverses the commit bcfad4265ced ("dlm: improve plock logging
if interrupted") by moving it to debug level and notifying the user an op
was removed.

Signed-off-by: Alexander Aring &lt;aahringo@redhat.com&gt;
Signed-off-by: David Teigland &lt;teigland@redhat.com&gt;
</content>
</entry>
</feed>
