Re: [Cluster-devel] [PATCH 16/27] iomap: switch iomap_bmap to use iomap_iter

2021-07-27 Thread Christoph Hellwig
On Mon, Jul 26, 2021 at 09:39:22AM -0700, Darrick J. Wong wrote: > The documentation needs to be much more explicit about the fact that you > cannot "break;" your way out of an iomap_iter loop. I think the comment > should be rewritten along these lines: > > "Iterate over filesystem-provided

Re: [Cluster-devel] gfs2 hang in xfstests generic/361 (v3)

2021-07-27 Thread Christoph Hellwig
On Mon, Jul 26, 2021 at 01:50:11PM -0500, Bob Peterson wrote: > FYI: I just pushed a replacement patch to linux-gfs2/for-next.next4. > The patch I mentioned last time had problems, so this is a simplified > middle-ground between that patch and the one I suggested earlier. > Patch is a89a427e0afe.

[Cluster-devel] [gfs2:for-next.mmap-fault 6/9] fs/iomap/direct-io.c:134 iomap_dio_complete() error: dereferencing freed memory 'dio'

2021-07-27 Thread Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git for-next.mmap-fault head: 1e32783802dce0f79d3b25e800ac86bd24512e10 commit: cbbd26b20cafc8f40d495be172ba807dc260845c [6/9] iomap: Add done_before argument to iomap_dio_rw config: x86_64-randconfig-m001-20210726

Re: [Cluster-devel] [PATCH v4 1/8] iov_iter: Introduce iov_iter_fault_in_writeable helper

2021-07-27 Thread Andreas Gruenbacher
On Tue, Jul 27, 2021 at 11:30 AM David Laight wrote: > From: Linus Torvalds > > Sent: 24 July 2021 20:53 > > > > On Sat, Jul 24, 2021 at 12:35 PM Andreas Gruenbacher > > wrote: > > > > > > +int iov_iter_fault_in_writeable(const struct iov_iter *i, size_t bytes) > > > +{ > > ... > > > +

Re: [Cluster-devel] [PATCH v4 1/8] iov_iter: Introduce iov_iter_fault_in_writeable helper

2021-07-27 Thread David Laight
From: Linus Torvalds > Sent: 24 July 2021 20:53 > > On Sat, Jul 24, 2021 at 12:35 PM Andreas Gruenbacher > wrote: > > > > +int iov_iter_fault_in_writeable(const struct iov_iter *i, size_t bytes) > > +{ > ... > > + if (fault_in_user_pages(start, len, true) != len) > > +

Re: [Cluster-devel] gfs2 hang in xfstests generic/361 (v3)

2021-07-27 Thread Andreas Gruenbacher
On Tue, Jul 27, 2021 at 4:05 PM Bob Peterson wrote: > On 7/27/21 2:05 AM, Christoph Hellwig wrote: > > On Mon, Jul 26, 2021 at 01:50:11PM -0500, Bob Peterson wrote: > >> FYI: I just pushed a replacement patch to linux-gfs2/for-next.next4. > >> The patch I mentioned last time had problems, so this

Re: [Cluster-devel] [PATCH 16/27] iomap: switch iomap_bmap to use iomap_iter

2021-07-27 Thread Darrick J. Wong
On Tue, Jul 27, 2021 at 08:31:38AM +0200, Christoph Hellwig wrote: > On Mon, Jul 26, 2021 at 09:39:22AM -0700, Darrick J. Wong wrote: > > The documentation needs to be much more explicit about the fact that you > > cannot "break;" your way out of an iomap_iter loop. I think the comment > > should

Re: [Cluster-devel] gfs2 hang in xfstests generic/361 (v3)

2021-07-27 Thread Bob Peterson
On 7/27/21 2:05 AM, Christoph Hellwig wrote: On Mon, Jul 26, 2021 at 01:50:11PM -0500, Bob Peterson wrote: FYI: I just pushed a replacement patch to linux-gfs2/for-next.next4. The patch I mentioned last time had problems, so this is a simplified middle-ground between that patch and the one I

Re: [Cluster-devel] gfs2 hang in xfstests generic/361 (v3)

2021-07-27 Thread Bob Peterson
On 7/27/21 2:05 AM, Christoph Hellwig wrote: On Mon, Jul 26, 2021 at 01:50:11PM -0500, Bob Peterson wrote: FYI: I just pushed a replacement patch to linux-gfs2/for-next.next4. The patch I mentioned last time had problems, so this is a simplified middle-ground between that patch and the one I

[Cluster-devel] [GFS2 PATCH 01/15] gfs2: Add wrapper for iomap_file_buffered_write

2021-07-27 Thread Bob Peterson
From: Andreas Gruenbacher Add a wrapper around iomap_file_buffered_write. We'll add code for when the operation needs to be retried here later. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/file.c | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git

[Cluster-devel] [GFS2 PATCH 06/15] gfs2: tiny cleanup in gfs2_log_reserve

2021-07-27 Thread Bob Peterson
Function gfs2_log_reserve was setting revoke_blks to 0. There's no need because it calculates it shortly thereafter. This patch removes the unnecessary set. Signed-off-by: Bob Peterson --- fs/gfs2/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/log.c

[Cluster-devel] [GFS2 PATCH 05/15] gfs2: trivial clean up of gfs2_ail_error

2021-07-27 Thread Bob Peterson
This patch does not change function. It adds variable sdp to clean up function gfs2_ail_error and make it more readable. Signed-off-by: Bob Peterson --- fs/gfs2/glops.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c index

[Cluster-devel] [GFS2 PATCH 04/15] gfs2: be more verbose replaying invalid rgrp blocks

2021-07-27 Thread Bob Peterson
This patch adds some crucial information when journal replay detects a replay of an obsolete rgrp block. For example, it wasn't printing the journal id or the generation number played. This just supplements what is logged in this unusual case. The function that actually complains about the

[Cluster-devel] [GFS2 PATCH 00/15] gfs2: misc. patch collection (V2)

2021-07-27 Thread Bob Peterson
This is version2 of a set of misc. patches from my collection. As before, they can be added individually or as a set. Changes from V1: 1. I added a wrapper patch Andreas wrote. I'm not sure how serious he is about this one. 2. This set omits the patch "New log flush watchdog" due to Steve

[Cluster-devel] [GFS2 PATCH 09/15] gfs2: fix deadlock in gfs2_ail1_empty withdraw

2021-07-27 Thread Bob Peterson
Before this patch, function gfs2_ail1_empty could issue a file system withdraw when IO errors were discovered. However, there are several callers, including gfs2_flush_revokes() which holds the gfs2_log_lock before calling gfs2_ail1_empty. If gfs2_ail1_empty needed to withdraw it would leave the

[Cluster-devel] [GFS2 PATCH 12/15] gfs2: Make recovery error more readable

2021-07-27 Thread Bob Peterson
Before this patch, withdraws could cause an error that looked like: Journal recovery skipped for 0 until next mount. This patch changes it to a more readable: Journal recovery skipped for jid 0 until next mount. Signed-off-by: Bob Peterson --- fs/gfs2/util.c | 2 +- 1 file changed, 1

[Cluster-devel] [GFS2 PATCH 08/15] gfs2: Don't release and reacquire local statfs bh

2021-07-27 Thread Bob Peterson
Before this patch, several functions in gfs2 related to the updating of the statfs file used a newly acquired/read buffer_head for the local statfs file. This is completely unnecessary, because other nodes should never update it. Recreating the buffer is a waste of time. This patch allows gfs2 to

[Cluster-devel] [GFS2 PATCH 11/15] gfs2: reduce redundant code in gfs2_trans_add_*

2021-07-27 Thread Bob Peterson
Before this patch, functions gfs2_trans_add_data and gfs2_trans_add_meta did similar checks to see if the buffer_head had an existing bd element, and if not, assigned one, temporarily dropping locks to allow for better simultaneous operations. These checks were identical except that the meta

[Cluster-devel] [GFS2 PATCH 13/15] gfs2: ignore usr|grp|prjquota mount options

2021-07-27 Thread Bob Peterson
Before this patch, gfs2 rejected mounts attempted with the usrquota, grpquota, or prjquota mount options. That caused numerous xfstests tests to fail. This patch allows gfs2 to accept but ignore those mount options so the tests may be run. Signed-off-by: Bob Peterson --- fs/gfs2/ops_fstype.c |

[Cluster-devel] [GFS2 PATCH 03/15] gfs2: Eliminate go_xmote_bh in favor of go_lock

2021-07-27 Thread Bob Peterson
Before this patch, the freeze glock was the only glock to use the go_xmote_bh glock op (glop). The go_xmote_bh glop is done when a glock is locked. But so is go_lock. This patch eliminates the glop altogether in favor of just using go_lock for the freeze glock. This is for better consistency,

[Cluster-devel] [GFS2 PATCH 10/15] gfs2: replace sd_aspace with sd_inode

2021-07-27 Thread Bob Peterson
Before this patch, gfs2 kept its own address space for rgrps, but this caused a lockdep problem because vfs assumes a 1:1 relationship between address spaces and their inode. One problematic area is this: gfs2_unpin mark_buffer_dirty(bh); mapping = page_mapping(page);

[Cluster-devel] [GFS2 PATCH 07/15] gfs2: init system threads before freeze lock

2021-07-27 Thread Bob Peterson
Patch 96b1454f2e ("gfs2: move freeze glock outside the make_fs_rw and _ro functions") changed the gfs2 mount sequence so that it holds the freeze lock before calling gfs2_make_fs_rw. Before this patch, gfs2_make_fs_rw called init_threads to initialize the quotad and logd threads. That is a problem

[Cluster-devel] [GFS2 PATCH 02/15] gfs2: Fix glock recursion in freeze_go_xmote_bh

2021-07-27 Thread Bob Peterson
We must not call gfs2_consist (which does a file system withdraw) from the freeze glock's freeze_go_xmote_bh function because the withdraw will try to use the freeze glock, thus causing a glock recursion error. This patch changes freeze_go_xmote_bh to call function gfs2_assert_withdraw_delayed

[Cluster-devel] [GFS2 PATCH 15/15] gfs2: Switch to may_setattr in gfs2_setattr

2021-07-27 Thread Bob Peterson
From: Andreas Gruenbacher The permission check in gfs2_setattr is an old and outdated version of may_setattr(). Switch to the updated version. Fixes fstest generic/079. Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson --- fs/gfs2/inode.c | 4 ++-- 1 file changed, 2

[Cluster-devel] [GFS2 PATCH 14/15] fs: Move notify_change permission checks into may_setattr

2021-07-27 Thread Bob Peterson
From: Andreas Gruenbacher Move the permission checks in notify_change into a separate function to make them available to filesystems. When notify_change is called, the vfs performs those checks before calling into iop->setattr. However, a filesystem like gfs2 can only lock and revalidate the

Re: [Cluster-devel] [PATCH v4 1/8] iov_iter: Introduce iov_iter_fault_in_writeable helper

2021-07-27 Thread Linus Torvalds
On Tue, Jul 27, 2021 at 4:14 AM Andreas Gruenbacher wrote: > > On Tue, Jul 27, 2021 at 11:30 AM David Laight wrote: > > > > Is it actually worth doing any more than ensuring the first byte > > of the buffer is paged in before entering the block that has > > to disable page faults? > > We

Re: [Cluster-devel] [GFS2 PATCH 09/15] gfs2: fix deadlock in gfs2_ail1_empty withdraw

2021-07-27 Thread Andreas Gruenbacher
Hi Bob, On Tue, Jul 27, 2021 at 7:37 PM Bob Peterson wrote: > Before this patch, function gfs2_ail1_empty could issue a file system > withdraw when IO errors were discovered. However, there are several > callers, including gfs2_flush_revokes() which holds the gfs2_log_lock > before calling