[Cluster-devel] [PATCH RESEND 6/8] dlm: be sure we reset all nodes at forced shutdown

2023-10-10 Thread Alexander Aring
In case we running in a force shutdown in either midcomms or lowcomms implementation we will make sure we reset all per midcomms node information. Cc: sta...@vger.kernel.org Fixes: 63e711b08160 ("fs: dlm: create midcomms nodes when configure") Signed-off-by: Alexander Aring -

[Cluster-devel] [PATCH RESEND 5/8] dlm: fix remove member after close call

2023-10-10 Thread Alexander Aring
ber(). Cc: sta...@vger.kernel.org Fixes: 63e711b08160 ("fs: dlm: create midcomms nodes when configure") Signed-off-by: Alexander Aring --- fs/dlm/midcomms.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/fs/dlm/midcomms.c b/fs/dlm/midcomms.c index 455265c6ba53..4ad

[Cluster-devel] [PATCH RESEND 7/8] dlm: fix no ack after final message

2023-10-10 Thread Alexander Aring
nd turning the receiving node into DLM_ESTABLISHED again. Cc: sta...@vger.kernel.org Fixes: 1696c75f1864 ("fs: dlm: add send ack threshold and append acks to msgs") Signed-off-by: Alexander Aring --- fs/dlm/midcomms.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

[Cluster-devel] [PATCH RESEND 8/8] dlm: slow down filling up processing queue

2023-10-10 Thread Alexander Aring
buffers from the socket after all messages were processed done by a flush_workqueue(). This however only occurs when we have a message burst when we e.g. create 1 million locks. If we put more and more new messages to process in the processqueue we will soon run out of memory. Signed-off-by: Alexander

[Cluster-devel] [PATCH RESEND 1/8] fs: dlm: Simplify buffer size computation in dlm_create_debug_file()

2023-10-10 Thread Alexander Aring
From: Christophe JAILLET Use sizeof(name) instead of the equivalent, but hard coded, DLM_LOCKSPACE_LEN + 8. This is less verbose and more future proof. Signed-off-by: Christophe JAILLET Signed-off-by: Alexander Aring --- fs/dlm/debug_fs.c | 10 +- 1 file changed, 5 insertions(+), 5

[Cluster-devel] [PATCH RESEND 3/8] fs: dlm: Remove some useless memset()

2023-10-10 Thread Alexander Aring
Signed-off-by: Alexander Aring --- fs/dlm/debug_fs.c | 5 - 1 file changed, 5 deletions(-) diff --git a/fs/dlm/debug_fs.c b/fs/dlm/debug_fs.c index c93359ceaae6..42f332f46359 100644 --- a/fs/dlm/debug_fs.c +++ b/fs/dlm/debug_fs.c @@ -986,7 +986,6 @@ void dlm_create_debug_file(struct dlm_ls

[Cluster-devel] [PATCH RESEND 4/8] dlm: fix creating multiple node structures

2023-10-10 Thread Alexander Aring
...@vger.kernel.org Fixes: 63e711b08160 ("fs: dlm: create midcomms nodes when configure") Signed-off-by: Alexander Aring --- fs/dlm/midcomms.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fs/dlm/midcomms.c b/fs/dlm/midcomms.c index f641b36a36db..455265c6ba53 100644 --

[Cluster-devel] [PATCH RESEND 2/8] fs: dlm: Fix the size of a buffer in dlm_create_debug_file()

2023-10-10 Thread Alexander Aring
LEN + 8, "%s_queued_asts", ls->ls_name); | ^~~~ Fixes: 541adb0d4d10b ("fs: dlm: debugfs for queued callbacks") Signed-off-by: Christophe JAILLET Signed-off-by: Alexander Aring --- fs/dlm/debug_fs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --

[Cluster-devel] [RFC dlm/next 07/10] fs: dlm: ls_root_lock semaphore to rwlock

2023-09-08 Thread Alexander Aring
This patch converts the ls_root_lock semaphore to a rwlock to not sleep during dlm message processing. Signed-off-by: Alexander Aring --- fs/dlm/dir.c | 14 +++--- fs/dlm/dlm_internal.h | 2 +- fs/dlm/lock.c | 4 ++-- fs/dlm/lockspace.c| 2 +- fs/dlm/recover.c

[Cluster-devel] [RFC dlm/next 01/10] fs: dlm: remove allocation parameter in msg allocation

2023-09-08 Thread Alexander Aring
just drop the allocation flag and have GFP_ATOMIC hardcoded when calling the allocation function. Signed-off-by: Alexander Aring --- fs/dlm/lock.c | 31 --- fs/dlm/lowcomms.c | 16 +++- fs/dlm/lowcomms.h | 5 ++--- fs/dlm/memory.c | 8 f

[Cluster-devel] [RFC dlm/next 05/10] fs: dlm: convert res_lock to spinlock

2023-09-08 Thread Alexander Aring
This patch converts the per dlm rsb res_lock from a mutex to a spinlock. Signed-off-by: Alexander Aring --- fs/dlm/dlm_internal.h | 2 +- fs/dlm/lock.c | 2 +- fs/dlm/lock.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/dlm/dlm_internal.h b/fs/dlm

[Cluster-devel] [RFC dlm/next 10/10] fs: dlm: do dlm message processing in softirq context

2023-09-08 Thread Alexander Aring
node message processing. Further patches will improve those behaviors. For now this patch will reduce the amount of interruptions when doing DLM message parsing. Signed-off-by: Alexander Aring --- fs/dlm/lowcomms.c | 34 ++ 1 file changed, 10 insertions(+), 24

[Cluster-devel] [RFC dlm/next 03/10] fs: dlm: remove explicit scheduling points

2023-09-08 Thread Alexander Aring
. Signed-off-by: Alexander Aring --- fs/dlm/lock.c | 2 -- fs/dlm/recover.c | 1 - fs/dlm/requestqueue.c | 1 - 3 files changed, 4 deletions(-) diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index 970b8499b66f..61eb285c613c 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c @@ -4979,7 +4979,6

[Cluster-devel] [RFC dlm/next 09/10] fs: dlm: convert message parsing locks to disable bh

2023-09-08 Thread Alexander Aring
This patch converts all spinlocks involved in message parsing to it's _bh version. The reason to do that is to convert the message parsing into softirq context and we need to prevent that those locks can be interrupted by a softirq if those are held. Signed-off-by: Alexander Aring --- f

[Cluster-devel] [RFC dlm/next 08/10] fs: dlm: ls_recv_active semaphore to rwlock

2023-09-08 Thread Alexander Aring
This patch converts the ls_recv_active semaphore to a rwlock to not sleep during dlm message processing. Signed-off-by: Alexander Aring --- fs/dlm/dlm_internal.h | 2 +- fs/dlm/lock.c | 4 ++-- fs/dlm/lockspace.c| 2 +- fs/dlm/member.c | 4 ++-- fs/dlm/recoverd.c | 4

[Cluster-devel] [RFC dlm/next 06/10] fs: dlm: make requestqueue handling non sleepable

2023-09-08 Thread Alexander Aring
message should be saved for future or not. When recovery processes all saved messages we will clear this bit again and allow new messages to processed directly. Signed-off-by: Alexander Aring --- fs/dlm/dlm_internal.h | 5 ++--- fs/dlm/lock.c | 16 ++-- fs/dlm/lockspace.c

[Cluster-devel] [RFC dlm/next 02/10] fs: dlm: switch to GFP_ATOMIC in dlm allocations

2023-09-08 Thread Alexander Aring
places. It's not possible anymore to preload idr allocations. However this is only a performance speedup and we might switch to xarray implementation with more lockless readers paradigms. Signed-off-by: Alexander Aring --- fs/dlm/lock.c | 2 -- fs/dlm/memory.c | 6 +++--- f

[Cluster-devel] [RFC dlm/next 04/10] fs: dlm: convert ls_waiters_mutex to spinlock

2023-09-08 Thread Alexander Aring
This patch converts the per dlm lockspace waiters lock from a mutex to a spinlock. Signed-off-by: Alexander Aring --- fs/dlm/debug_fs.c | 4 ++-- fs/dlm/dlm_internal.h | 2 +- fs/dlm/lock.c | 33 + fs/dlm/lockspace.c| 2 +- 4 files changed, 21

[Cluster-devel] [PATCH dlm/next 3/6] dlm: be sure we reset all nodes at forced shutdown

2023-09-06 Thread Alexander Aring
In case we running in a force shutdown in either midcomms or lowcomms implementation we will make sure we reset all per midcomms node information. Cc: sta...@vger.kernel.org Fixes: 63e711b08160 ("fs: dlm: create midcomms nodes when configure") Signed-off-by: Alexander Aring -

[Cluster-devel] [PATCH dlm/next 5/6] dlm: fix string may be truncated

2023-09-06 Thread Alexander Aring
ytes to 13 because _queued_asts does not fit into 8 bytes when the whole lockspace name length is being used. Fixes: 541adb0d4d10 ("fs: dlm: debugfs for queued callbacks") Signed-off-by: Alexander Aring --- fs/dlm/debug_fs.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-)

[Cluster-devel] [PATCH dlm/next 2/6] dlm: fix remove member after close call

2023-09-06 Thread Alexander Aring
ber(). Cc: sta...@vger.kernel.org Fixes: 63e711b08160 ("fs: dlm: create midcomms nodes when configure") Signed-off-by: Alexander Aring --- fs/dlm/midcomms.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/fs/dlm/midcomms.c b/fs/dlm/midcomms.c index 455265c6ba53..4ad

[Cluster-devel] [PATCH dlm/next 6/6] dlm: slow down filling up processing queue

2023-09-06 Thread Alexander Aring
processqueue we will soon run out of memory. The testcase to reproduce this issue can be found at: https://gitlab.com/netcoder/linux-public/-/blob/dlm_test_burst/fs/dlm/dlm_bursttest.c Signed-off-by: Alexander Aring --- fs/dlm/lowcomms.c | 12 1 file changed, 12 insertions(+) diff --git a

[Cluster-devel] [PATCH dlm/next 1/6] dlm: fix creating multiple node structures

2023-09-06 Thread Alexander Aring
...@vger.kernel.org Fixes: 63e711b08160 ("fs: dlm: create midcomms nodes when configure") Signed-off-by: Alexander Aring --- fs/dlm/midcomms.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fs/dlm/midcomms.c b/fs/dlm/midcomms.c index f641b36a36db..455265c6ba53 100644 --

[Cluster-devel] [PATCH dlm/next 4/6] dlm: fix no ack after final message

2023-09-06 Thread Alexander Aring
nd turning the receiving node into DLM_ESTABLISHED again. Cc: sta...@vger.kernel.org Fixes: 1696c75f1864 ("fs: dlm: add send ack threshold and append acks to msgs") Signed-off-by: Alexander Aring --- fs/dlm/midcomms.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

Re: [Cluster-devel] [PATCH 6/7] dlm: use FL_SLEEP to determine blocking vs non-blocking

2023-08-30 Thread Alexander Aring
Hi, On Fri, Aug 25, 2023 at 2:18 PM Jeff Layton wrote: > > On Wed, 2023-08-23 at 17:33 -0400, Alexander Aring wrote: > > This patch uses the FL_SLEEP flag in struct file_lock to determine if > > the lock request is a blocking or non-blocking request. Before dlm was > &g

Re: [Cluster-devel] [PATCH 1/7] lockd: introduce safe async lock op

2023-08-30 Thread Alexander Aring
Hi, On Fri, Aug 25, 2023 at 1:21 PM Chuck Lever wrote: > > On Wed, Aug 23, 2023 at 05:33:46PM -0400, Alexander Aring wrote: > > This patch reverts mostly commit 40595cdc93ed ("nfs: block notification > > on fs with its own ->lock") and introduces an EXPORT_OP_SAF

Re: [Cluster-devel] [PATCH 2/7] lockd: don't call vfs_lock_file() for pending requests

2023-08-30 Thread Alexander Aring
Hi, On Fri, Aug 25, 2023 at 2:10 PM Jeff Layton wrote: > > On Wed, 2023-08-23 at 17:33 -0400, Alexander Aring wrote: > > This patch returns nlm_lck_blocked in nlmsvc_lock() when an asynchronous > > lock request is pending. During testing I ran into the case with the > >

Re: [Cluster-devel] [PATCH] generic: add fcntl corner cases tests

2023-08-29 Thread Alexander Aring
Hi, On Tue, Aug 29, 2023 at 12:43 AM Zorro Lang wrote: > > On Wed, Aug 23, 2023 at 05:08:14PM -0400, Alexander Aring wrote: > > This patch adds generic 730 testcase. It will test on various fcntl() > > The generic/730 has been taken. The case number might be changed when I m

Re: [Cluster-devel] [PATCH dlm/next] dlm: fix plock lookup when using multiple lockspaces

2023-08-25 Thread Alexander Aring
Hi, On Thu, Aug 24, 2023 at 7:22 PM Alexander Aring wrote: ... > > The reason why I probably never saw it is because those fields in my > tests are always the same and we simply don't compare all fields on > the sanity check. I need to correct some things here... the patch work

Re: [Cluster-devel] [PATCH dlm/next] dlm: fix plock lookup when using multiple lockspaces

2023-08-24 Thread Alexander Aring
Hi, On Thu, Aug 24, 2023 at 4:51 PM Alexander Aring wrote: > > This patch fixes an issues when concurrent fcntl() syscalls are > executing on two different gfs2 filesystems. Each gfs2 filesystem > creates an DLM lockspace, it seems that VFS only allows fcntl() syscalls > at on

[Cluster-devel] [PATCH dlm/next] dlm: fix plock lookup when using multiple lockspaces

2023-08-24 Thread Alexander Aring
bally defined. After this patch the sanity check never warned again that the wrong plock op was being looked up. Cc: sta...@vger.kernel.org Reported-by: Barry Marson Fixes: 57e2c2f2d94c ("fs: dlm: fix mismatch of plock results from userspace") Signed-off-by: Alexander Aring --- fs/

[Cluster-devel] [PATCH 0/7] lockd: dlm: async lock request changes

2023-08-23 Thread Alexander Aring
LEEP to determine if it's blocking vs non-blocking in DLM Alexander Aring (7): lockd: introduce safe async lock op lockd: don't call vfs_lock_file() for pending requests lockd: fix race in async lock request handling lockd: add doc to enable EXPORT_OP_SAFE_ASYNC_LOCK dlm: use

[Cluster-devel] [PATCH 3/7] lockd: fix race in async lock request handling

2023-08-23 Thread Alexander Aring
evel to hit the -EAGAIN case. Signed-off-by: Alexander Aring --- fs/lockd/svclock.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index aa4174fbaf5b..3b158446203b 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c @

[Cluster-devel] [PATCH 2/7] lockd: don't call vfs_lock_file() for pending requests

2023-08-23 Thread Alexander Aring
same nlm_block is triggered two lm_grant() callbacks will occur but lockd was only waiting for one. To avoid any change of existing users this handling will only being made when export_op_support_safe_async_lock() returns true. Signed-off-by: Alexander Aring --- fs/lockd/svclock.c

[Cluster-devel] [PATCH 1/7] lockd: introduce safe async lock op

2023-08-23 Thread Alexander Aring
et the EXPORT_OP_SAFE_ASYNC_LOCK export flag and update the DLM plock implementation regarding to it. Acked-by: Jeff Layton Signed-off-by: Alexander Aring --- fs/lockd/svclock.c | 5 ++--- fs/nfsd/nfs4state.c | 13 ++--- include/linux/exportfs.h | 8 3 files changed,

[Cluster-devel] [PATCH 4/7] lockd: add doc to enable EXPORT_OP_SAFE_ASYNC_LOCK

2023-08-23 Thread Alexander Aring
This patch adds a note to enable EXPORT_OP_SAFE_ASYNC_LOCK for asynchronous lock request handling. Signed-off-by: Alexander Aring --- fs/locks.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index df8b26a42524..edee02d1ca93 100644 --- a

[Cluster-devel] [PATCH 6/7] dlm: use FL_SLEEP to determine blocking vs non-blocking

2023-08-23 Thread Alexander Aring
. Signed-off-by: Alexander Aring --- fs/dlm/plock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c index 0094fa4004cc..0c6ed5eeb840 100644 --- a/fs/dlm/plock.c +++ b/fs/dlm/plock.c @@ -140,7 +140,7 @@ int dlm_posix_lock(dlm_lockspace_t *lockspace, u64

[Cluster-devel] [PATCH 7/7] dlm: implement EXPORT_OP_SAFE_ASYNC_LOCK

2023-08-23 Thread Alexander Aring
: Alexander Aring --- fs/gfs2/export.c | 1 + fs/ocfs2/export.c | 1 + 2 files changed, 2 insertions(+) diff --git a/fs/gfs2/export.c b/fs/gfs2/export.c index cf40895233f5..36bc43b9d141 100644 --- a/fs/gfs2/export.c +++ b/fs/gfs2/export.c @@ -192,5 +192,6 @@ const struct export_operations

[Cluster-devel] [PATCH 5/7] dlm: use fl_owner from lockd

2023-08-23 Thread Alexander Aring
should be separated. This patch lets lockd define how to deal with lock contexts and chose hopefully the right fl_owner value. A test after this patch was made and the locks conflicts each other which should be the case. Acked-by: Jeff Layton Signed-off-by: Alexander Aring --- fs/dlm/plock.

[Cluster-devel] [PATCH] generic: add fcntl corner cases tests

2023-08-23 Thread Alexander Aring
routines when a process blocking in F_SETLKW to wait the lock request getting granted and the process gets killed. A similar test is fcntl_lock_signal_interrupt which checks for side-effects e.g. unlock all previous acquired locks when a blocking F_SETLKW gets interrupted by a signal. Signed-off-by:

[Cluster-devel] [PATCH dlm-tool 2/3] dlm_controld: update container_of() implementation

2023-08-21 Thread Alexander Aring
This patch updates the container_of() implementation taken from the Linux kernel. We need to turn off -Wpointer-arith as the new container_of() implementation does void pointer artihmetic as shown by this example warning: linux_helpers.h:43:26: warning: pointer of type ‘void *’ used in arithmetic

[Cluster-devel] [PATCH dlm-tool 3/3] dlm_controld: update list implementation

2023-08-21 Thread Alexander Aring
This patch updates the list implementation taken from the Linux kernel. There are new list manipulation functions introduced that could be became useful later. --- dlm_controld/linux_helpers.h | 7 + dlm_controld/list.h | 667 ++- 2 files changed, 576 ins

[Cluster-devel] [PATCH dlm-tool 1/3] dlm_controld: update rbtree implementation

2023-08-21 Thread Alexander Aring
This patch updates the rbtree implementation taken from the Linux kernel. --- README.license | 3 + dlm_controld/linux_helpers.h| 11 + dlm_controld/list.h | 1 - dlm_controld/rbtree.c | 724 +--- dlm_controld/rbtree.h

Re: [Cluster-devel] [RFCv2 1/7] lockd: fix race in async lock request handling

2023-08-17 Thread Alexander Aring
Hi, On Tue, Aug 15, 2023 at 2:21 PM Jeff Layton wrote: > > On Tue, 2023-08-15 at 13:49 -0400, Jeff Layton wrote: > > On Mon, 2023-08-14 at 17:11 -0400, Alexander Aring wrote: > > > This patch fixes a race in async lock request handling between adding > > > th

Re: [Cluster-devel] [RFCv2 1/7] lockd: fix race in async lock request handling

2023-08-17 Thread Alexander Aring
Hi, On Tue, Aug 15, 2023 at 1:49 PM Jeff Layton wrote: > > On Mon, 2023-08-14 at 17:11 -0400, Alexander Aring wrote: > > This patch fixes a race in async lock request handling between adding > > the relevant struct nlm_block to nlm_blocked list after the request was > &g

[Cluster-devel] [PATCH dlm-tool] dlm_controld: fix various deadcode issues

2023-08-17 Thread Alexander Aring
This patch fix various deadcode issues discovered by coverity. The flags from the shutdown_callback() aren't flags, we need to use == to get the shutdown request type. The value COROSYNC_CFG_SHUTDOWN_FLAG_REQUEST is 0 and will never be true in this case. The strstr() need to be incremented after c

Re: [Cluster-devel] [RFCv2 6/7] dlm: use FL_SLEEP to check if blocking request

2023-08-17 Thread Alexander Aring
Hi, On Thu, Aug 17, 2023 at 7:27 AM Jeff Layton wrote: > > On Wed, 2023-08-16 at 21:19 -0400, Alexander Aring wrote: > > Hi, > > > > On Wed, Aug 16, 2023 at 9:07 AM Jeff Layton wrote: > > > > > > On Mon, 2023-08-14 at 17:11 -0400, Alexander Aring wrote:

Re: [Cluster-devel] [RFCv2 2/7] lockd: FILE_LOCK_DEFERRED only on FL_SLEEP

2023-08-16 Thread Alexander Aring
Hi, On Wed, Aug 16, 2023 at 7:37 AM Jeff Layton wrote: > > On Mon, 2023-08-14 at 17:11 -0400, Alexander Aring wrote: > > This patch removes to handle non-blocking lock requests as asynchronous > > lock request returning FILE_LOCK_DEFERRED. When fl_lmops and lm_grant() &g

Re: [Cluster-devel] [RFCv2 4/7] locks: update lock callback documentation

2023-08-16 Thread Alexander Aring
Hi, On Wed, Aug 16, 2023 at 8:01 AM Jeff Layton wrote: > > On Mon, 2023-08-14 at 17:11 -0400, Alexander Aring wrote: > > This patch updates the existing documentation regarding recent changes > > to vfs_lock_file() and lm_grant() is set. In case of lm_grant() is set

Re: [Cluster-devel] [RFCv2 6/7] dlm: use FL_SLEEP to check if blocking request

2023-08-16 Thread Alexander Aring
Hi, On Wed, Aug 16, 2023 at 9:07 AM Jeff Layton wrote: > > On Mon, 2023-08-14 at 17:11 -0400, Alexander Aring wrote: > > This patch uses the FL_SLEEP flag in struct file_lock to check if it's a > > blocking request in case if the request coming from nfs lockd process &g

[Cluster-devel] [RFCv2 5/7] dlm: use fl_owner from lockd

2023-08-14 Thread Alexander Aring
should be separated. This patch lets lockd define how to deal with lock contexts and chose hopefully the right fl_owner value. A test after this patch was made and the locks conflicts each other which should be the case. Signed-off-by: Alexander Aring --- fs/dlm/plock.c | 18 ---

[Cluster-devel] [RFCv2 7/7] dlm: implement EXPORT_OP_SAFE_ASYNC_LOCK

2023-08-14 Thread Alexander Aring
: Alexander Aring --- fs/gfs2/export.c | 1 + fs/ocfs2/export.c | 1 + 2 files changed, 2 insertions(+) diff --git a/fs/gfs2/export.c b/fs/gfs2/export.c index cf40895233f5..36bc43b9d141 100644 --- a/fs/gfs2/export.c +++ b/fs/gfs2/export.c @@ -192,5 +192,6 @@ const struct export_operations

[Cluster-devel] [RFCv2 6/7] dlm: use FL_SLEEP to check if blocking request

2023-08-14 Thread Alexander Aring
called to signal the lock was granted. If it's not set a synchronous non-blocking request is being made. Signed-off-by: Alexander Aring --- fs/dlm/plock.c | 38 ++ 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/fs/dlm/plock.c b/fs/dl

[Cluster-devel] [RFCv2 4/7] locks: update lock callback documentation

2023-08-14 Thread Alexander Aring
FL_SLEEP is not set, are handled in a synchronized way. Signed-off-by: Alexander Aring --- fs/locks.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index df8b26a42524..a8e51f462b43 100644 --- a/fs/locks.c +++ b/fs

[Cluster-devel] [RFCv2 3/7] lockd: introduce safe async lock op

2023-08-14 Thread Alexander Aring
et the EXPORT_OP_SAFE_ASYNC_LOCK export flag and update the DLM plock implementation regarding to it. Signed-off-by: Alexander Aring --- fs/lockd/svclock.c | 5 ++--- fs/nfsd/nfs4state.c | 13 ++--- include/linux/exportfs.h | 8 3 files changed, 20 insertions(+)

[Cluster-devel] [RFCv2 2/7] lockd: FILE_LOCK_DEFERRED only on FL_SLEEP

2023-08-14 Thread Alexander Aring
in the same time as unlock or cancellation operations as those are trylock operations only. In case of a blocking lock request we need to have it asynchronously because the time when the lock request getting granted is unknown. Signed-off-by: Alexander Aring --- fs/lockd/svclock.c | 39

[Cluster-devel] [RFCv2 0/7] fs: nfs: async lock request changes

2023-08-14 Thread Alexander Aring
filesystem supports asynchronous lock request calls - fix block variable never NULL when iterating over nlm_blocked list Alexander Aring (7): lockd: fix race in async lock request handling lockd: FILE_LOCK_DEFERRED only on FL_SLEEP lockd: introduce safe async lock op locks: update loc

[Cluster-devel] [RFCv2 1/7] lockd: fix race in async lock request handling

2023-08-14 Thread Alexander Aring
evel to hit the -EAGAIN case. Signed-off-by: Alexander Aring --- fs/lockd/svclock.c | 100 ++-- include/linux/lockd/lockd.h | 2 + 2 files changed, 74 insertions(+), 28 deletions(-) diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index c43ccdf28ed

Re: [Cluster-devel] [RFC v6.5-rc2 2/3] fs: lockd: fix race in async lock request handling

2023-08-10 Thread Alexander Aring
Hi, On Fri, Jul 21, 2023 at 12:43 PM Jeff Layton wrote: > > On Fri, 2023-07-21 at 09:09 -0400, Alexander Aring wrote: > > Hi, > > > > On Thu, Jul 20, 2023 at 8:58 AM Alexander Aring wrote: > > > > > > This patch fixes a race in async lock request

Re: [Cluster-devel] [RFC v6.5-rc2 2/3] fs: lockd: fix race in async lock request handling

2023-08-10 Thread Alexander Aring
Hi, On Fri, Jul 21, 2023 at 11:45 AM Jeff Layton wrote: > > On Thu, 2023-07-20 at 08:58 -0400, Alexander Aring wrote: > > This patch fixes a race in async lock request handling between adding > > the relevant struct nlm_block to nlm_blocked list after the request was > &g

Re: [Cluster-devel] [RFC v6.5-rc2 3/3] fs: lockd: introduce safe async lock op

2023-08-10 Thread Alexander Aring
Hi, On Fri, Jul 21, 2023 at 1:46 PM Jeff Layton wrote: > > On Thu, 2023-07-20 at 08:58 -0400, Alexander Aring wrote: > > This patch reverts mostly commit 40595cdc93ed ("nfs: block notification > > on fs with its own ->lock") and introduces an EXPORT_OP_SAFE_ASYNC

[Cluster-devel] [RFC xfstests] generic: add fcntl corner cases tests

2023-08-09 Thread Alexander Aring
routines when a process blocking in F_SETLKW to wait the lock request getting granted and the process gets killed. A similar test is fcntl_lock_signal_interrupt which checks for side-effects e.g. unlock all previous acquired locks when a blocking F_SETLKW gets interrupted by a signal. Signed-off-by:

[Cluster-devel] [PATCHv2 dlm-next 09/13] fs: dlm: drop rxbuf manipulation in dlm_copy_master_names

2023-08-01 Thread Alexander Aring
-by: Alexander Aring --- fs/dlm/dir.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/dlm/dir.c b/fs/dlm/dir.c index 3bf5bf7a37b4..768cf8d43b2b 100644 --- a/fs/dlm/dir.c +++ b/fs/dlm/dir.c @@ -245,9 +245,8 @@ void dlm_copy_master_names(struct dlm_ls *ls, char *inbuf

[Cluster-devel] [PATCHv2 dlm-next 00/13] fs: dlm: miscs and msgs processing changes

2023-08-01 Thread Alexander Aring
s nodes and lowcomms connections into one. - Alex changes since v2: - add a cover-letter - fix a deadlock case in "fs: dlm: create midcomms nodes when configure" Alexander Aring (13): fs: dlm: add missing spin_unlock fs: dlm: remove unused processed_nodes fs: dlm: debugfs for queued

[Cluster-devel] [PATCHv2 dlm-next 05/13] fs: dlm: add plock dev tracepoints

2023-08-01 Thread Alexander Aring
I currently debug nfs plock handling and introduce those two tracepoints for getting more information about what is happening there if the user space reads plock operations from kernel and writing the result back. Signed-off-by: Alexander Aring --- fs/dlm/plock.c | 6 + include

[Cluster-devel] [PATCHv2 dlm-next 07/13] fs: dlm: cleanup lock order

2023-08-01 Thread Alexander Aring
This patch cleanups the lock order to hold at first the close_lock and then held the nodes_srcu read lock. Probably it will never be a problem as nodes_srcu is only a read lock preventing the node pointer getting freed. Signed-off-by: Alexander Aring --- fs/dlm/midcomms.c | 4 ++-- 1 file

[Cluster-devel] [PATCHv2 dlm-next 11/13] fs: dlm: constify receive buffer

2023-08-01 Thread Alexander Aring
The dlm receive buffer should be never manipulated as DLM is the last instance of parsing layer. This patch constify the whole receive buffer so we are sure it never gets manipulated when it's being parsed. Signed-off-by: Alexander Aring --- fs/dlm/dir.c | 5 +- fs/dlm/

[Cluster-devel] [PATCHv2 dlm-next 01/13] fs: dlm: add missing spin_unlock

2023-08-01 Thread Alexander Aring
g found. Fixes: dc52cd2eff4a ("fs: dlm: fix F_CANCELLK to cancel pending request") Signed-off-by: Alexander Aring --- fs/dlm/plock.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c index 943d9f8e5564..44b3aab5b709 100644 --- a/fs/dlm/plock.c +++ b/fs/dlm

[Cluster-devel] [PATCHv2 dlm-next 08/13] fs: dlm: get recovery sequence number as parameter

2023-08-01 Thread Alexander Aring
r lockspace variable to use it for the replying message. This patch will pass the sequence number as parameter so another read of ls->ls_recover_seq and holding the ls->ls_recover_lock is not required. Signed-off-by: Alexander Aring --- fs/dlm/dir.c | 4 +-- fs/dlm/dir.h | 2

[Cluster-devel] [PATCHv2 dlm-next 02/13] fs: dlm: remove unused processed_nodes

2023-08-01 Thread Alexander Aring
The variable processed_nodes is not being used by commit 1696c75f1864 ("fs: dlm: add send ack threshold and append acks to msgs"). This patch removes the leftover of this commit. Signed-off-by: Alexander Aring --- fs/dlm/lowcomms.c | 1 - 1 file changed, 1 deletion(-) diff --gi

[Cluster-devel] [PATCHv2 dlm-next 10/13] fs: dlm: drop rxbuf manipulation in dlm_recover_master_copy

2023-08-01 Thread Alexander Aring
message in paremter assigned with call by reference. Later when dlm_send_rcom_lock() constructs a new message and memcpy() the receive buffer those values will be set on the new constructed message. Signed-off-by: Alexander Aring --- fs/dlm/lock.c | 10 +++--- fs/dlm/lock.h | 3 ++- fs/dlm

[Cluster-devel] [PATCHv2 dlm-next 06/13] fs: dlm: remove clear_members_cb

2023-08-01 Thread Alexander Aring
This patch is just a small cleanup to directly call remove_remote_member() instead of going over clear_members_cb() which just calls remove_remote_member(). Signed-off-by: Alexander Aring --- fs/dlm/member.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/fs/dlm

[Cluster-devel] [PATCHv2 dlm-next 12/13] fs: dlm: create midcomms nodes when configure

2023-08-01 Thread Alexander Aring
t well set DLM_VERSION_NOT_SET as version. This indicates that the version of the midcomms node is still unknown and need to be probed via certain rcom messages. Signed-off-by: Alexander Aring --- fs/dlm/config.c | 2 +- fs/dlm/midcomms.c | 286 +---

[Cluster-devel] [PATCHv2 dlm-next 03/13] fs: dlm: debugfs for queued callbacks

2023-08-01 Thread Alexander Aring
that looks like a ast callback was not processed, we can confirm now that it is not sitting to be processed by the callback workqueue anymore. Signed-off-by: Alexander Aring --- fs/dlm/debug_fs.c | 101 +- fs/dlm/dlm_internal.h | 1 + 2 files ch

[Cluster-devel] [PATCHv2 dlm-next 04/13] fs: dlm: check on plock ops when exit dlm

2023-08-01 Thread Alexander Aring
To be sure we don't have any issues that there are leftover plock ops in either send_list or recv_list we simple check if either one of the list are empty when we exit the dlm subsystem. Signed-off-by: Alexander Aring --- fs/dlm/plock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[Cluster-devel] [PATCHv2 dlm-next 13/13] fs: dlm: don't use RCOM_NAMES for version detection

2023-08-01 Thread Alexander Aring
reliability layer aka stateless message. This patch changes that RCOM_NAMES we are sending out after this patch are not stateless anymore. Signed-off-by: Alexander Aring --- fs/dlm/rcom.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/dlm/rcom.c b/fs/dlm

Re: [Cluster-devel] [PATCH dlm-next 12/13] fs: dlm: create midcomms nodes when configure

2023-07-27 Thread Alexander Aring
Hi, On Thu, Jul 27, 2023 at 9:23 AM Alexander Aring wrote: > > This patch puts the life of a midcomms node the same as a lowcomms > connection. The lowcomms connection lifetime was changed by commit > 6f0b0b5d7ae7 ("fs: dlm: remove dlm_node_addrs lookup list"). In the >

[Cluster-devel] [PATCH dlm-next 12/13] fs: dlm: create midcomms nodes when configure

2023-07-27 Thread Alexander Aring
t well set DLM_VERSION_NOT_SET as version. This indicates that the version of the midcomms node is still unknown and need to be probed via certain rcom messages. Signed-off-by: Alexander Aring --- fs/dlm/config.c | 2 +- fs/dlm/midcomms.c | 286 +---

[Cluster-devel] [PATCH dlm-next 04/13] fs: dlm: check on plock ops when exit dlm

2023-07-27 Thread Alexander Aring
To be sure we don't have any issues that there are leftover plock ops in either send_list or recv_list we simple check if either one of the list are empty when we exit the dlm subsystem. Signed-off-by: Alexander Aring --- fs/dlm/plock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[Cluster-devel] [PATCH dlm-next 11/13] fs: dlm: constify receive buffer

2023-07-27 Thread Alexander Aring
The dlm receive buffer should be never manipulated as DLM is the last instance of parsing layer. This patch constify the whole receive buffer so we are sure it never gets manipulated when it's being parsed. Signed-off-by: Alexander Aring --- fs/dlm/dir.c | 5 +- fs/dlm/

[Cluster-devel] [PATCH dlm-next 08/13] fs: dlm: get recovery sequence number as parameter

2023-07-27 Thread Alexander Aring
r lockspace variable to use it for the replying message. This patch will pass the sequence number as parameter so another read of ls->ls_recover_seq and holding the ls->ls_recover_lock is not required. Signed-off-by: Alexander Aring --- fs/dlm/dir.c | 4 +-- fs/dlm/dir.h | 2

[Cluster-devel] [PATCH dlm-next 09/13] fs: dlm: drop rxbuf manipulation in dlm_copy_master_names

2023-07-27 Thread Alexander Aring
-by: Alexander Aring --- fs/dlm/dir.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/dlm/dir.c b/fs/dlm/dir.c index 3bf5bf7a37b4..768cf8d43b2b 100644 --- a/fs/dlm/dir.c +++ b/fs/dlm/dir.c @@ -245,9 +245,8 @@ void dlm_copy_master_names(struct dlm_ls *ls, char *inbuf

[Cluster-devel] [PATCH dlm-next 13/13] fs: dlm: don't use RCOM_NAMES for version detection

2023-07-27 Thread Alexander Aring
reliability layer aka stateless message. This patch changes that RCOM_NAMES we are sending out after this patch are not stateless anymore. Signed-off-by: Alexander Aring --- fs/dlm/rcom.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/dlm/rcom.c b/fs/dlm

[Cluster-devel] [PATCH dlm-next 07/13] fs: dlm: cleanup lock order

2023-07-27 Thread Alexander Aring
This patch cleanups the lock order to hold at first the close_lock and then held the nodes_srcu read lock. Probably it will never be a problem as nodes_srcu is only a read lock preventing the node pointer getting freed. Signed-off-by: Alexander Aring --- fs/dlm/midcomms.c | 4 ++-- 1 file

Re: [Cluster-devel] [PATCHv3 v6.5-rc2 3/3] fs: dlm: fix F_CANCELLK to cancel pending request

2023-07-25 Thread Alexander Aring
Hi, On Tue, Jul 18, 2023 at 2:07 PM Alexander Aring wrote: > > This patch fixes the current handling of F_CANCELLK by not just doing a > unlock as we need to try to cancel a lock at first. A unlock makes sense > on a non-blocking lock request but if it's a blocking lock req

Re: [Cluster-devel] [PATCHv4 v6.5-rc2 3/3] fs: dlm: fix F_CANCELLK to cancel pending request

2023-07-24 Thread Alexander Aring
Hi, On Mon, Jul 24, 2023 at 3:03 PM Alexander Aring wrote: > > Hi, > > On Mon, Jul 24, 2023 at 10:40 AM Andreas Gruenbacher > wrote: > > > > On Fri, Jul 21, 2023 at 8:55 PM Alexander Aring wrote: > > > Hi, > > > > > > On Fri, Jul

Re: [Cluster-devel] [PATCHv4 v6.5-rc2 3/3] fs: dlm: fix F_CANCELLK to cancel pending request

2023-07-24 Thread Alexander Aring
Hi, On Mon, Jul 24, 2023 at 10:40 AM Andreas Gruenbacher wrote: > > On Fri, Jul 21, 2023 at 8:55 PM Alexander Aring wrote: > > Hi, > > > > On Fri, Jul 21, 2023 at 12:25 PM Andreas Gruenbacher > > wrote: > > > > > > On Thu, Jul 20, 2023 at 2:2

Re: [Cluster-devel] [PATCHv4 v6.5-rc2 3/3] fs: dlm: fix F_CANCELLK to cancel pending request

2023-07-21 Thread Alexander Aring
Hi, On Fri, Jul 21, 2023 at 12:25 PM Andreas Gruenbacher wrote: > > On Thu, Jul 20, 2023 at 2:22 PM Alexander Aring wrote: > > This patch fixes the current handling of F_CANCELLK by not just doing a > > unlock as we need to try to cancel a lock at first. A unlock makes

Re: [Cluster-devel] [RFC v6.5-rc2 2/3] fs: lockd: fix race in async lock request handling

2023-07-21 Thread Alexander Aring
Hi, On Thu, Jul 20, 2023 at 8:58 AM Alexander Aring wrote: > > This patch fixes a race in async lock request handling between adding > the relevant struct nlm_block to nlm_blocked list after the request was > sent by vfs_lock_file() and nlmsvc_grant_deferred() does a lookup of the &g

[Cluster-devel] [RFC v6.5-rc2 2/3] fs: lockd: fix race in async lock request handling

2023-07-20 Thread Alexander Aring
ed. If the vfs_lock_file() results in an case when it wouldn't be added to nlm_blocked list, the nlm_block struct will be removed from this list again. Signed-off-by: Alexander Aring --- fs/lockd/svclock.c | 80 +++-- include/linux/lockd/lockd.h | 1 +

[Cluster-devel] [RFC v6.5-rc2 3/3] fs: lockd: introduce safe async lock op

2023-07-20 Thread Alexander Aring
et the EXPORT_OP_SAFE_ASYNC_LOCK export flag and update the DLM plock implementation regarding to it. Signed-off-by: Alexander Aring --- fs/lockd/svclock.c | 5 ++--- fs/nfsd/nfs4state.c | 11 --- include/linux/exportfs.h | 1 + 3 files changed, 11 insertions(+), 6 deletions(-

[Cluster-devel] [RFC v6.5-rc2 1/3] fs: lockd: nlm_blocked list race fixes

2023-07-20 Thread Alexander Aring
from any context. Cc: sta...@vger.kernel.org Signed-off-by: Alexander Aring --- fs/lockd/svclock.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index c43ccdf28ed9..28abec5c451d 100644 --- a/fs/lockd/svclock.c +++ b/fs

[Cluster-devel] [PATCHv4 v6.5-rc2 3/3] fs: dlm: fix F_CANCELLK to cancel pending request

2023-07-20 Thread Alexander Aring
This patch fixes the current handling of F_CANCELLK by not just doing a unlock as we need to try to cancel a lock at first. A unlock makes sense on a non-blocking lock request but if it's a blocking lock request we need to cancel the request until it's not granted yet. This patch is fixing this beh

[Cluster-devel] [PATCHv4 v6.5-rc2 2/3] fs: dlm: allow to F_SETLKW getting interrupted

2023-07-20 Thread Alexander Aring
This patch implements dlm plock F_SETLKW interruption feature. If a blocking posix lock request got interrupted in user space by a signal a cancellation request for a non granted lock request to the user space lock manager will be send. The user lock manager answers either with zero or a negative e

[Cluster-devel] [PATCHv4 v6.5-rc2 1/3] fs: dlm: remove twice newline

2023-07-20 Thread Alexander Aring
This patch removes a newline which log_print() already adds, also removes wrapped string that causes a checkpatch warning. --- fs/dlm/plock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c index 70a4752ed913..a34f605d8505 100644 --- a/fs/dlm

[Cluster-devel] [PATCHv4 v6.5-rc2 0/3] fs: dlm: lock cancellation feature

2023-07-20 Thread Alexander Aring
uot;fs: dlm: remove twice newline" because I saw this while doing nfs lockd experiments. Alexander Aring (3): fs: dlm: remove twice newline fs: dlm: allow to F_SETLKW getting interrupted fs: dlm: fix F_CANCELLK to cancel pending request fs/dlm/plock.c | 163

Re: [Cluster-devel] [PATCHv3 v6.5-rc2 3/3] fs: dlm: fix F_CANCELLK to cancel pending request

2023-07-19 Thread Alexander Aring
Hi, On Tue, Jul 18, 2023 at 2:07 PM Alexander Aring wrote: > > This patch fixes the current handling of F_CANCELLK by not just doing a > unlock as we need to try to cancel a lock at first. A unlock makes sense > on a non-blocking lock request but if it's a blocking lock req

[Cluster-devel] [PATCHv2 dlm-tool] fs: dlm: implement DLM_PLOCK_OP_CANCEL

2023-07-18 Thread Alexander Aring
This patch implements DLM_PLOCK_OP_CANCEL to try to delete waiters for a lock request which are waiting to being granted. If the waiter can be deleted the reply is 0. If the waiter cannot be found it will return -ENOENT to the kernel, either that there never was be a waiter or we were to late to ca

[Cluster-devel] [PATCHv3 v6.5-rc2 0/3] fs: dlm: lock cancellation feature

2023-07-18 Thread Alexander Aring
back will synchronize it now. - remove DLM_PLOCK_OP_FLAG_INTERRUPTED as it's not necessary anymore because waiting for a reply of DLM_PLOCK_OP_CANCEL we don't need to handle this special case anymore. - add "fs: dlm: remove twice newline" because I saw this while doing nfs lockd ex

[Cluster-devel] [PATCHv3 v6.5-rc2 3/3] fs: dlm: fix F_CANCELLK to cancel pending request

2023-07-18 Thread Alexander Aring
never being updated regarding to this change. Future patches will try to fix lockd lock requests for DLM. This patch is currently assuming the upstream DLM lockd handling is correct. Signed-off-by: Alexander Aring --- fs/dlm/plock.c| 102 +- fs/gfs2

  1   2   3   4   5   6   7   8   9   10   >