Re: [Cluster-devel] [PATCH v6.4-rc2 5/5] fs: dlm: avoid F_SETLKW plock op lookup collisions

2023-05-19 Thread Alexander Aring
Hi, On Fri, May 19, 2023 at 11:21 AM Alexander Aring wrote: > > This patch fixes a possible plock op collisions when using F_SETLKW lock > requests and fsid, number and owner are not enough to identify a result > for a pending request. The ltp testcases [0] and [1] are examples when > this is

[Cluster-devel] [PATCH dlm/next 1/2] fs: dlm: plock debugfs to check for pending operations

2023-05-19 Thread Alexander Aring
In the past issues were found that there were still ongoing plock operations in the kernel but it should cleanup routines should clear them up because there were no plock activity by the user anymore. To check that "dlm_tool plocks $LS" can be used, but this only shows pending operations in

[Cluster-devel] [PATCH dlm/next 2/2] fs: dlm: cleanup plock op lookup functionality

2023-05-19 Thread Alexander Aring
This patch will introduce plock_op_lookup() to lookup a plock op when a result needs to lookup the plock op to find the original request. Besides that we add additional sanity check to confirm the lookup is still working in case of non F_SETLKW request as it requires a specific order in recv_list.

[Cluster-devel] [PATCH v6.4-rc2 3/5] fs: dlm: switch posix lock to killable only

2023-05-19 Thread Alexander Aring
This patch will revert commit a6b1533e9a57 ("dlm: make posix locks interruptible"). It was probably introduced to reach the fcntl() F_SETLKW requirement to make fcntl() calls interruptible, see: "F_SETLKW (struct flock *): As for F_SETLK, but if a conflicting lock is held on the file, then

[Cluster-devel] [PATCH v6.4-rc2 1/5] fs: dlm: change local pids to be positive pids

2023-05-19 Thread Alexander Aring
This patch fixes to set local processes and their pid value represented inside the struct flock when using F_GETLK if there is a conflict with another process. Currently every pid in struct flock l_pid is set as negative pid number. This was changed by commit 9d5b86ac13c5 ("fs/locks: Remove

[Cluster-devel] [PATCH v6.4-rc2 5/5] fs: dlm: avoid F_SETLKW plock op lookup collisions

2023-05-19 Thread Alexander Aring
This patch fixes a possible plock op collisions when using F_SETLKW lock requests and fsid, number and owner are not enough to identify a result for a pending request. The ltp testcases [0] and [1] are examples when this is not enough in case of using classic posix locks with threads and open

[Cluster-devel] [PATCH v6.4-rc2 4/5] fs: dlm: make F_SETLK not killable

2023-05-19 Thread Alexander Aring
This patch changes that only F_SETLKW will be killable. As the man page of fcntl() states out that F_SETLKW is the only one interruptible cmd as I supposed it can block an unknown amount of time when it hits contention. We use killable for the same reason just that the process isn't alive anymore.

[Cluster-devel] [PATCH v6.4-rc2 2/5] fs: dlm: fix cleanup pending ops when interrupted

2023-05-19 Thread Alexander Aring
This patch mainly reverts what commit b92a4e3f86b1 ("fs: dlm: change posix lock sigint handling") introduced. Except two things, checking if op->done got true under ops_lock after it got interrupted and changing "no op" messages to debug printout. There is currently problems with cleaning up

Re: [Cluster-devel] [PATCH 01/17] fs: unexport buffer_check_dirty_writeback

2023-05-19 Thread Hannes Reinecke
On 4/24/23 07:49, Christoph Hellwig wrote: buffer_check_dirty_writeback is only used by the block device aops, remove the export. Signed-off-by: Christoph Hellwig --- fs/buffer.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/buffer.c b/fs/buffer.c index

Re: [Cluster-devel] [PATCH 16/17] block: use iomap for writes to block devices

2023-05-19 Thread Hannes Reinecke
On 4/24/23 07:49, Christoph Hellwig wrote: Use iomap in buffer_head compat mode to write to block devices. Signed-off-by: Christoph Hellwig --- block/Kconfig | 1 + block/fops.c | 33 + 2 files changed, 30 insertions(+), 4 deletions(-) diff --git

[Cluster-devel] [PATCH 10/13] fs: factor out a direct_write_fallback helper

2023-05-19 Thread Christoph Hellwig
Add a helper dealing with handling the syncing of a buffered write fallback for direct I/O. Signed-off-by: Christoph Hellwig --- fs/libfs.c | 36 include/linux/fs.h | 2 ++ mm/filemap.c | 59 ++ 3 files

[Cluster-devel] [PATCH 07/13] iomap: update ki_pos in iomap_file_buffered_write

2023-05-19 Thread Christoph Hellwig
All callers of iomap_file_buffered_write need to updated ki_pos, move it into common code. Signed-off-by: Christoph Hellwig --- fs/gfs2/file.c | 4 +--- fs/iomap/buffered-io.c | 9 ++--- fs/xfs/xfs_file.c | 2 -- fs/zonefs/file.c | 4 +--- 4 files changed, 8

[Cluster-devel] [PATCH 06/13] filemap: add a kiocb_invalidate_post_write helper

2023-05-19 Thread Christoph Hellwig
Add a helper to invalidate page cache after a dio write. Signed-off-by: Christoph Hellwig --- fs/direct-io.c | 10 ++ fs/iomap/direct-io.c| 12 ++-- include/linux/fs.h | 5 - include/linux/pagemap.h | 1 + mm/filemap.c| 37

[Cluster-devel] cleanup the filemap / direct I/O interaction

2023-05-19 Thread Christoph Hellwig
Hi all, this series cleans up some of the generic write helper calling conventions and the page cache writeback / invalidation for direct I/O. This is a spinoff from the no-bufferhead kernel project, for while we'll want to an use iomap based buffered write path in the block layer. diffstat:

[Cluster-devel] [PATCH 11/13] fuse: update ki_pos in fuse_perform_write

2023-05-19 Thread Christoph Hellwig
Both callers of fuse_perform_write need to updated ki_pos, move it into common code. Signed-off-by: Christoph Hellwig --- fs/fuse/file.c | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index

[Cluster-devel] [PATCH 05/13] filemap: add a kiocb_invalidate_pages helper

2023-05-19 Thread Christoph Hellwig
Factor out a helper that calls filemap_write_and_wait_range and invalidate_inode_pages2_rangefor a the range covered by a write kiocb or returns -EAGAIN if the kiocb is marked as nowait and there would be pages to write or invalidate. Signed-off-by: Christoph Hellwig --- include/linux/pagemap.h

[Cluster-devel] [PATCH 02/13] filemap: update ki_pos in generic_perform_write

2023-05-19 Thread Christoph Hellwig
All callers of generic_perform_write need to updated ki_pos, move it into common code. Signed-off-by: Christoph Hellwig --- fs/ceph/file.c | 2 -- fs/ext4/file.c | 9 +++-- fs/f2fs/file.c | 1 - fs/nfs/file.c | 1 - mm/filemap.c | 8 5 files changed, 7 insertions(+), 14

[Cluster-devel] [PATCH 08/13] iomap: assign current->backing_dev_info in iomap_file_buffered_write

2023-05-19 Thread Christoph Hellwig
Move the assignment to current->backing_dev_info from the callers into iomap_file_buffered_write to reduce boiler plate code and reduce the scope to just around the page dirtying loop. Note that zonefs was missing this assignment before. Signed-off-by: Christoph Hellwig --- fs/gfs2/file.c

[Cluster-devel] [PATCH 09/13] iomap: use kiocb_write_and_wait and kiocb_invalidate_pages

2023-05-19 Thread Christoph Hellwig
Use the common helpers for direct I/O page invalidation instead of open coding the logic. This leads to a slight reordering of checks in __iomap_dio_rw to keep the logic straight. Signed-off-by: Christoph Hellwig --- fs/iomap/direct-io.c | 55 1

[Cluster-devel] [PATCH 04/13] filemap: add a kiocb_write_and_wait helper

2023-05-19 Thread Christoph Hellwig
Factor out a helper that does filemap_write_and_wait_range for a the range covered by a read kiocb, or returns -EAGAIN if the kiocb is marked as nowait and there would be pages to write. Signed-off-by: Christoph Hellwig --- block/fops.c| 18 +++---

[Cluster-devel] [PATCH 01/13] iomap: update ki_pos a little later in iomap_dio_complete

2023-05-19 Thread Christoph Hellwig
Move the ki_pos update down a bit to prepare for a better common helper that invalidates pages based of an iocb. Signed-off-by: Christoph Hellwig --- fs/iomap/direct-io.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/fs/iomap/direct-io.c

[Cluster-devel] [PATCH 03/13] filemap: assign current->backing_dev_info in generic_perform_write

2023-05-19 Thread Christoph Hellwig
Move the assignment to current->backing_dev_info from the callers into generic_perform_write to reduce boiler plate code and reduce the scope to just around the page dirtying loop. Signed-off-by: Christoph Hellwig --- fs/ceph/file.c | 4 fs/ext4/file.c | 3 --- fs/f2fs/file.c | 2 --

[Cluster-devel] [PATCH 13/13] fuse: use direct_write_fallback

2023-05-19 Thread Christoph Hellwig
Use the generic direct_write_fallback helper instead of duplicating the logic. Signed-off-by: Christoph Hellwig --- fs/fuse/file.c | 27 +++ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index

[Cluster-devel] [PATCH 12/13] fuse: drop redundant arguments to fuse_perform_write

2023-05-19 Thread Christoph Hellwig
pos is always equal to iocb->ki_pos, and mapping is always equal to iocb->ki_filp->f_mapping. Signed-off-by: Christoph Hellwig --- fs/fuse/file.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index fd2f27f2144750..5f7b58798f99fc