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 a/fs/gfs2/file.c b/fs/gfs2/f
e
iterator passed to .read_iter isn't in memory.
Signed-off-by: Andreas Gruenbacher
---
include/linux/pagemap.h | 1 +
include/linux/uio.h | 1 +
lib/iov_iter.c | 41 +++
mm/gup.c| 61 +
4 files changed,
When switching from __get_user to fault_in_pages_readable, commit 9f9eae5ce717
broke kvm_use_magic_page: fault_in_pages_readable returns 0 on success. Fix
that.
Fixes: 9f9eae5ce717 ("powerpc/kvm: Prefer fault_in_pages_readable function")
Cc: sta...@vger.kernel.org # v4.18+
Signed-off-b
tive value. Fix both
functions.
In addition, change iov_iter_get_pages_alloc to return NULL in that case to
prevent resource leaks.
It seems that the cifs and nfs filesystems don't handle the zero case very
well. Could the maintainers please have a look?
Signed-off-by: Andreas Gruenb
py if any
pages can be faulted in.
Rename iov_iter_fault_in_readable to an unfortunately clumsy
fault_in_iov_iter_readable to make sure that code that uses it can be fixed
instead of breaking silently.
Fix up the existing users.
Signed-off-by: Andreas Gruenbacher
---
fs/btrfs/file.c
safely allowing that, but more work remains to be done.
For immediate consideration by Al Viro:
iov_iter: Fix iov_iter_get_pages{,_alloc} page fault return value
For immediate consideration by Paul Mackerras:
powerpc/kvm: Fix kvm_use_magic_page
Thanks,
Andreas
Andreas Gruenbacher (12)
Signed-off-by: Andreas Gruenbacher
---
arch/powerpc/kernel/kvm.c | 3 +-
arch/powerpc/kernel/signal_32.c | 4 +-
arch/powerpc/kernel/signal_64.c | 2 +-
arch/x86/kernel/fpu/signal.c| 8 ++--
drivers/gpu/drm/armada/armada_gem.c | 7 ++--
fs/btrfs/ioctl.c
ghtly tidy up the error handling.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/bmap.c | 13 +++--
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index ed8b67b21718..84ad0fe787ea 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -866,12 +8
On Wed, Jul 28, 2021 at 10:33 PM Bob Peterson wrote:
> On 7/28/21 1:28 PM, Andreas Gruenbacher wrote:
> > On Tue, Jul 27, 2021 at 7:37 PM Bob Peterson wrote:
> >> Before this patch, gfs2 rejected mounts attempted with the usrquota,
> >> grpquota, or prjquota mount op
On Tue, Jul 27, 2021 at 7:37 PM Bob Peterson wrote:
> 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
On Tue, Jul 13, 2021 at 9:34 PM Bob Peterson wrote:
> On 7/13/21 1:26 PM, Steven Whitehouse wrote:
>
> Hi,
>
> On Tue, 2021-07-13 at 13:09 -0500, Bob Peterson wrote:
>
> Before this patch, gfs2 kept its own address space for rgrps, but
> this
> caused a lockdep problem because vfs assumes a 1:1 re
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 gfs2_a
patches from Andreas were added that allow xfstests
>generic/079 to run on gfs2.
>
> Most of these patches are very safe and well-tested.
> I left out some of my more experimental patches.
>
> Andreas Gruenbacher (3):
> gfs2: Add wrapper for iomap_file_buffered_write
>
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
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_wri
On Sat, Jul 24, 2021 at 11:57 PM Al Viro wrote:
> On Sat, Jul 24, 2021 at 11:38:20PM +0200, Andreas Gruenbacher wrote:
>
> > Hmm, how could we have sub-page failure areas when this is about if
> > and how pages are mapped? If we return the number of bytes that are
> > acc
On Sat, Jul 24, 2021 at 10:24 PM Al Viro wrote:
> On Sat, Jul 24, 2021 at 12:52:34PM -0700, Linus Torvalds wrote:
> > ...
> > > + if (fault_in_user_pages(start, len, true) != len)
> > > + return -EFAULT;
> >
> > Looking at this once more, I think
-by: Andreas Gruenbacher
---
fs/iomap/direct-io.c | 13 +
include/linux/iomap.h | 7 +++
2 files changed, 20 insertions(+)
diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c
index 51831ce93f6e..1ba825bab08b 100644
--- a/fs/iomap/direct-io.c
+++ b/fs/iomap/direct-io.c
, but it
may make sense to check for this flag in other contexts as well.
Signed-off-by: Andreas Gruenbacher
---
include/linux/uio.h | 1 +
lib/iov_iter.c | 20 +++-
2 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/include/linux/uio.h b/include/linux/uio.h
index
call iomap_dio_rw again for the rest of the request,
passing in the number of bytes already tranferred.
Signed-off-by: Andreas Gruenbacher
---
fs/btrfs/file.c | 5 +++--
fs/ext4/file.c| 5 +++--
fs/gfs2/file.c| 4 ++--
fs/iomap/direct-io.c | 12
fs/xfs/xfs_f
s won't affect the vfs or iomap patches.
Thanks a lot,
Andreas
Andreas Gruenbacher (8):
iov_iter: Introduce iov_iter_fault_in_writeable helper
gfs2: Add wrapper for iomap_file_buffered_write
gfs2: Fix mmap + page fault deadlocks for buffered I/O
iomap: Fix iomap_dio_rw return valu
physical page faults. Those manual page faults can be
disabled with the new iocb->noio flag.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/file.c | 47 +--
1 file changed, 45 insertions(+), 2 deletions(-)
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
in
s manually, and repeat the operation.
This locking problem in gfs2 was originally reported by Jan Kara. Linus came
up with the proposal to disable page faults. Many thanks to Al Viro and
Matthew Wilcox for their feedback as well.
Signed-off-by: Andreas Gruenbacher
---
fs/g
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 a/fs/gfs2/file.c b/fs/gfs2/f
When a user copy fails in one of the helpers of iomap_dio_rw, fail with -EFAULT
instead of returning 0. This matches what iomap_dio_bio_actor already returns
when it gets an -EFAULT from bio_iov_iter_get_pages.
Signed-off-by: Andreas Gruenbacher
---
fs/iomap/direct-io.c | 4 ++--
1 file
r isn't in memory.
Signed-off-by: Andreas Gruenbacher
---
include/linux/mm.h | 3 +++
include/linux/uio.h | 1 +
lib/iov_iter.c | 40 +++
mm/gup.c| 57 +
4 files changed, 101 insertions(+)
diff --git
page faults. Those manual page faults can be
disabled with the iocb->noio flag.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/file.c | 34 +-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index f66ac7f56
, but it
may make sense to check for this flag in other contexts as well.
Signed-off-by: Andreas Gruenbacher
---
include/linux/uio.h | 1 +
lib/iov_iter.c | 20 +++-
2 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/include/linux/uio.h b/include/linux/uio.h
index
chronously after dealing
with the page fault. To make that work, the completion notification would have
to include the bytes read or written before the page fault(s) as well, and we'd
need an additional iomap_dio_rw argument for that.
Signed-off-by: Andreas Gruenbacher
---
fs/iomap/
When a user copy fails in one of the helpers of iomap_dio_rw, fail with -EFAULT
instead of returning 0. This matches what iomap_dio_bio_actor already returns
when it gets an -EFAULT from bio_iov_iter_get_pages.
Signed-off-by: Andreas Gruenbacher
---
fs/iomap/direct-io.c | 4 ++--
1 file
s manually, and repeat the operation.
This locking problem in gfs2 was originally reported by Jan Kara. Linus came
up with the proposal to disable page faults. Many thanks to Al Viro and
Matthew Wilcox for their feedback as well.
Signed-off-by: Andreas Gruenbacher
---
fs/g
Signed-off-by: Andreas Gruenbacher
---
include/linux/mm.h | 3 ++
include/linux/uio.h | 1 +
lib/iov_iter.c | 42
mm/gup.c| 68 +
4 files changed, 114 insertions(+)
diff --git a/include/linux/mm.h b/inc
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 a/fs/gfs2/file.c b/fs/gfs2/f
need to be reviewed by Christoph at least:
iomap: Fix iomap_dio_rw return value for user copies
iomap: Support restarting direct I/O requests after user copy failures
Thanks a lot,
Andreas
Andreas Gruenbacher (7):
iov_iter: Introduce fault_in_iov_iter helper
gfs2: Add wra
is enough for iomaop_dio_rw(), but it may
make sense to check for this flag in other contexts as well.
Signed-off-by: Andreas Gruenbacher
---
include/linux/uio.h | 15 ---
lib/iov_iter.c | 20 +++-
2 files changed, 27 insertions(+), 8 deletions(-)
diff --git a
: in that position,
we know that we should have been able to read something.
Signed-off-by: Andreas Gruenbacher
---
fs/iomap/direct-io.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c
index 9398b8c31323..a87a43ee8278 100644
--- a/fs/iomap/direct
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 a/fs/gfs2/file.c b/fs/gfs2/f
7;m currently trying to get
initial feedback from Al and Christoph on that.
Any feedback would be welcome.
Thanks a lot,
Andreas
Andreas Gruenbacher (6):
iov_iter: Introduce fault_in_iov_iter helper
iomap: Fix iomap_dio_rw return value for page faults
gfs2: Add wrapper for iomap_file_buffer
e new
ITER_FLAG_FAST_ONLY flag for telling iomap_dio_rw to stop faulting pages in for
us.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/file.c | 35 ++-
1 file changed, 34 insertions(+), 1 deletion(-)
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 99df793
s manually, and repeat the operation.
This locking problem in gfs2 was originally reported by Jan Kara. Linus came
up with the proposal to disable page faults. Many thanks to Al Viro and
Matthew Wilcox for their feedback as well.
Signed-off-by: Andreas Gruenbacher
---
fs/g
Signed-off-by: Andreas Gruenbacher
---
include/linux/mm.h | 3 ++
include/linux/uio.h | 1 +
lib/iov_iter.c | 42
mm/gup.c| 68 +
4 files changed, 114 insertions(+)
diff --git a/include/linux/mm.h b/inc
Hi Colin,
On Mon, Jul 12, 2021 at 6:24 PM Colin King wrote:
>
> From: Colin Ian King
>
> In the case where IS_ERR(lsi->si_sc_inode) is true the error exit path
> to free_local does not kfree the allocated object lsi leading to a memory
> leak. Fix this by kfree'ing lst before taking the error ex
On Fri, Jul 9, 2021 at 6:29 AM Darrick J. Wong wrote:
> On Wed, Jul 07, 2021 at 01:55:24PM +0200, Andreas Gruenbacher wrote:
> > Now that we create those objects in iomap_writepage_map when needed,
> > there's no need to pre-create them in iomap_page_mkwrite_actor anymore.
&
ges in the
future (eg page split).
Co-developed-by: Matthew Wilcox (Oracle)
Signed-off-by: Matthew Wilcox (Oracle)
Signed-off-by: Andreas Gruenbacher
Reviewed-by: Christoph Hellwig
---
fs/iomap/buffered-io.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/iomap/buffered
Now that we create those objects in iomap_writepage_map when needed,
there's no need to pre-create them in iomap_page_mkwrite_actor anymore.
Signed-off-by: Andreas Gruenbacher
---
fs/iomap/buffered-io.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/iomap/buffered-io.c b/fs/
n't have private data attached in iomap_read_inline_data.
Signed-off-by: Andreas Gruenbacher
---
fs/iomap/buffered-io.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 598fcfabc337..6330dabc451e 100644
--- a/fs/iomap/
this should now be unnecessary
as well, but testing has proven that we're not quite at that point,
yet.
* Don't create iomap_page objects in iomap_page_mkwrite_actor anymore;
this clearly has become obsolete with the first patch.
Thanks,
Andreas
Andreas Gruenbacher (3):
ioma
On Tue, Jul 6, 2021 at 7:07 AM Christoph Hellwig wrote:
> On Mon, Jul 05, 2021 at 08:18:23PM +0200, Andreas Gruenbacher wrote:
> > In iomap_readpage_actor, don't create iop objects for inline inodes.
> > Otherwise, iomap_read_inline_data will set PageUptodate without setti
from pages in the future (eg page split).
Co-developed-by: Matthew Wilcox (Oracle)
Signed-off-by: Matthew Wilcox (Oracle)
Signed-off-by: Andreas Gruenbacher
---
fs/iomap/buffered-io.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered
n't have private data attached in iomap_read_inline_data.
Signed-off-by: Andreas Gruenbacher
Reviewed-by: Matthew Wilcox (Oracle)
---
fs/iomap/buffered-io.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index
Christoph has pointed out [*], there are several more cases in which
we can avoid iop creation. Those improvements are still left to be done.
[*] https://lore.kernel.org/linux-fsdevel/ynqy0e4xfwhdh...@infradead.org/
Thanks,
Andreas
Andreas Gruenbacher (2):
iomap: Don't create iomap
On Wed, Jun 30, 2021 at 2:29 PM Andreas Gruenbacher wrote:
> Darrick,
>
> will you pick up those two patches and push them to Linus? They both
> seem pretty safe.
Hello, is there anybody out there?
I've put the two patches here with the sign-offs they've received:
http
On Thu, Jul 1, 2021 at 11:41 PM Linus Torvalds
wrote:
> On Thu, Jul 1, 2021 at 1:43 PM Andreas Gruenbacher
> wrote:
> > here's another attempt at fixing the mmap + page fault deadlocks we're
> > seeing on gfs2. Still not ideal because get_user_pages_
page faults was suggested by Linus, with help from Al Viro and
Matthew Wilcox.
Reported-by: Jan Kara
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/file.c | 81 ++
1 file changed, 81 insertions(+)
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
inde
On Wed, Jun 30, 2021 at 4:09 PM Matthew Wilcox wrote:
> On Tue, Jun 29, 2021 at 11:12:39AM +0200, Andreas Gruenbacher wrote:
> > Below is a version of your patch on top of v5.13 which has passed some
> > local testing here.
> >
> > Thanks,
> > Andreas
>
Darrick,
On Tue, Jun 29, 2021 at 7:47 AM Christoph Hellwig wrote:
> On Mon, Jun 28, 2021 at 10:59:55PM +0100, Matthew Wilcox wrote:
> > > > so permit pages without an iop to enter writeback and create an iop
> > > > *then*. Would that solve your problem?
> > >
> > > It is the right thing to do,
Andreas Gruenbacher (6):
gfs2: Fix do_gfs2_set_flags description
gfs2: Fix underflow in gfs2_page_mkwrite
gfs2: Fix error handling in init_statfs
gfs2: Clean up the error handling in gfs2_page_mkwrite
gfs2
having to worry about how the
iop block tracking is implemented.
Suggested-by: Matthew Wilcox
Signed-off-by: Andreas Gruenbacher
---
fs/iomap/buffered-io.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 03537ecb2a94
On Mon, Jun 28, 2021 at 8:07 PM Christoph Hellwig wrote:
> On Mon, Jun 28, 2021 at 06:39:09PM +0100, Matthew Wilcox wrote:
> > Not hugely happy with either of these options, tbh. I'd rather we apply
> > a patch akin to this one (plucked from the folio tree), so won't apply:
>
> > so permit pages
On Mon, Jun 28, 2021 at 7:40 PM Matthew Wilcox wrote:
> On Mon, Jun 28, 2021 at 07:27:25PM +0200, Andreas Gruenbacher wrote:
> > (1) In iomap_readpage_actor, an iomap_page is attached to the page even
> > for inline inodes. This is unnecessary because inline inodes don't
From: Bob Peterson
Add function iomap_uninline_inode for converting an inline inode into a
non-inline inode. This takes care of attaching a new iomap_page object
to page->private if the block size is smaller than the page size.
Signed-off-by: Andreas Gruenbacher
---
fs/iomap/buffered-i
n't have private data attached in iomap_read_inline_data.
Signed-off-by: Andreas Gruenbacher
---
fs/iomap/buffered-io.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 9023717c5188..03537ecb2a94 100644
--- a/fs/iomap/
/git/gfs2/linux-gfs2.git/log/?h=for-next.iomap-page-mkwrite
Any thoughts?
Thanks,
Andreas
Andreas Gruenbacher (1):
iomap: Don't create iomap_page objects for inline files
Bob Peterson (1):
iomap: Add helper for un-inlining an inline inode
fs/iomap/buffered-io.c | 28 +
Hi Jing,
On Mon, Jun 28, 2021 at 1:22 PM Jing Xiangfeng wrote:
> In an error path of init_statfs(), it calls iput to put pn which has been
> put. Jump to correct label to fix it.
thanks for your patch. This looks okay, but I'd rather set pn to NULL
after the iput instead. Since iput(NULL) is a n
On Tue, Jun 8, 2021 at 5:23 AM Baokun Li wrote:
> Using list_move_tail() instead of list_del() + list_add_tail().
Thanks, I'll add that to for-next.
Andreas
06-02 11:44:54 +0200)
gfs2: Recognize mmap + page fault self-recursion to prevent deadlocks
--------
Andreas Gruenbacher (4):
gfs2: Clean up the error handling in gfs2_page_mkwrite
g
On Tue, Jun 1, 2021 at 8:00 AM Linus Torvalds
wrote:
> On Mon, May 31, 2021 at 7:01 AM Andreas Gruenbacher
> wrote:
> >
> > Fix that by recognizing the self-recursion case.
>
> Hmm. I get the feeling that the self-recursion case should never have
> been allowed t
fba483f235:
Revert "gfs2: Fix mmap locking for write faults" (2021-06-01 23:16:42 +0200)
Revert broken commit
--------
Andreas Gruenbacher (1):
Revert "g
ecipients. Feel free to quote more just in case
> others didn't get my original email through the lists.
>
> I'll be out most of the day, but I'll try to take a deeper look this evening.
>
> I'm the meantime, a couple of questions and comments..
>
> On Mon, M
On Mon, May 31, 2021 at 6:30 PM Linus Torvalds
wrote:
> [ Adding fsdevel, because this is not limited to gfs2 ]
>
> On Mon, May 31, 2021 at 12:56 AM Andreas Gruenbacher
> wrote:
> >
> > Andreas Gruenbacher (2):
> > gfs2: Fix mmap locking for write faults
>
d fault in
the first offending user page. This will re-trigger the "inner" locking
attempt but without the "outer" glock being held and without the
LM_FLAG_TRY flag. Once that's done, we re-acquire the "outer" glock and
retry the original operation.
Reported-by: Jan K
When a glock holder has the LM_FLAG_OUTER flag set, we set the
current_holds_glock() flag upon taking the lock. With that, we
can recognize when trying to take an "inner" glock, and react
accordingly.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/glock.c | 12
fs/gf
Use the lowest two bits in current->journal_info to encode when
we're holding a glock, and when an operation holding a glock
needs to be retried.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/incore.h | 35 +--
1 file changed, 33 insertions(+), 2 d
No longer access current->journal_info directly. The next patch will
change the wrappers to encode additional information in the lower bits
of current->journal_info.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/aops.c| 6 +++---
fs/gfs2/bmap.c| 28 ++
Add the equivalent of iov_iter_fault_in_readable(), but for pages that
will be written to.
While at it, fix an indentation error in iov_iter_fault_in_readable().
Signed-off-by: Andreas Gruenbacher
---
include/linux/uio.h | 1 +
lib/iov_iter.c | 20 +++-
2 files changed
will handle these case more gracefully by retrying
operations instead of failing them, along with addressing more complex
deadlock scenarios.
Reported-by: Jan Kara
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/file.c | 40 ++--
1 file changed, 30 insertions
This function checks if a glock holder's locking state is compatible with
another locking state.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/glock.h | 14 ++
1 file changed, 14 insertions(+)
diff --git a/fs/gfs2/glock.h b/fs/gfs2/glock.h
index 31a8f2f649b5..f0ef6fd24ba4 1
osting of this patch queue:
https://listman.redhat.com/archives/cluster-devel/2021-May/msg00073.html
New xfstest for mmap + page faults during read / write:
https://lore.kernel.org/fstests/20210531152604.240462-1-agrue...@redhat.com/
Andreas Gruenbacher (9):
gfs2: Clean up the error handling in gfs2_pa
We're setting an error number so that block_page_mkwrite_return
translates it into the corresponding VM_FAULT_* code in several places,
but this is getting confusing, so set the VM_FAULT_* codes directly
instead. (No change in functionality.)
Signed-off-by: Andreas Gruenbacher
---
fs
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 a/fs/gfs2/file.c b/fs/gfs2/f
03:28 +0200)
Various gfs2 fixes
Andreas Gruenbacher (2):
gfs2: Prevent direct-I/O write fallback errors from getting lost
gfs2: Fix mmap locking for write f
On Fri, May 21, 2021 at 5:23 PM Jan Kara wrote:
> On Thu 20-05-21 16:07:56, Andreas Gruenbacher wrote:
> > On Thu, May 20, 2021 at 3:30 PM Jan Kara wrote:
> > > On Thu 20-05-21 14:25:36, Andreas Gruenbacher wrote:
> > > > Now that we handle self-recursion on the
gfs2/glock.c:1993: warning: Excess function parameter 'wait' description
> in 'gfs2_gl_hash_clear'
What's that? Those warnings don't exist in mainline, and the two
warnings we have in mainline are fixed in for-next:
https://git.kernel.org/pub/scm/linux/kernel/gi
On Thu, May 20, 2021 at 3:30 PM Jan Kara wrote:
> On Thu 20-05-21 14:25:36, Andreas Gruenbacher wrote:
> > Now that we handle self-recursion on the inode glock in gfs2_fault and
> > gfs2_page_mkwrite, we need to take care of more complex deadlock
> > scenarios like the foll
Add the equivalent of iov_iter_fault_in_readable(), but for pages that will be
written to.
While at it, fix an indentation error in iov_iter_fault_in_readable().
Signed-off-by: Andreas Gruenbacher
---
include/linux/uio.h | 1 +
lib/iov_iter.c | 20 +++-
2 files changed
Use the lowest two bits in current->journal_info to encode when
we're holding a glock and when an operation holding a glock
needs to be retried.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/incore.h | 35 +--
1 file changed, 33 insertions(+), 2 d
d fault in
the first offending user page. This will re-trigger the "inner" locking
attempt but without the LM_FLAG_TRY flag. Once that has happened, we
re-acquire the "outer" glock and retry the original operation.
Reported-by: Jan Kara
Signed-off
No longer access current->journal_info directly. We'll use that to
encode additional information in current->journal_info later.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/aops.c| 6 +++---
fs/gfs2/bmap.c| 28 ++--
fs/gfs2/incore.h | 10
handle this case more gracefully, along with addressing
more complex deadlock scenarios.
Reported-by: Jan Kara
Fixes: 20f82c38 ("gfs2: Rework read and page fault locking")
Cc: sta...@vger.kernel.org # v5.8+
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/f
When a glock holder has the LM_FLAG_OUTER flag set, we set the
current_holds_glock() flag upon taking the lock. With that flag set, we can
then recognize when trying to take an "inner" glock and react accordingly.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/glock.c | 12 ++
operation,
https://lore.kernel.org/linux-fsdevel/20210511140113.1225981-1-agrue...@redhat.com/
[2]
https://lore.kernel.org/fstests/20210520114218.1595735-1-agrue...@redhat.com/T/#u
[3]
https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git/log/?h=for-next
Andreas Gruenbacher (6)
On Wed, May 19, 2021 at 8:08 AM Hillf Danton wrote:
> The GLF_LRU flag is checked under lru_lock in gfs2_glock_remove_from_lru() to
> remove glock from the lru list in __gfs2_glock_put().
>
> On the shrink scan path, the same flag is cleared under lru_lock but because
> of cond_resched_lock(&lru_l
When a write fault occurs, we need to take the inode glock of the underlying
inode in exclusive mode. Otherwise, there's no guarantee that the dirty page
will be written back to disk.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/file.c | 4 +++-
1 file changed, 3 insertions(+), 1 del
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 a/fs/gfs2/file.c b/fs/gfs2/f
This function checks if a glock holder's locking state is compatible with
another locking state.
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/glock.h | 14 ++
1 file changed, 14 insertions(+)
diff --git a/fs/gfs2/glock.h b/fs/gfs2/glock.h
index 31a8f2f649b5..f0ef6fd24ba4 1
We're setting an error number so that block_page_mkwrite_return
translates it into the corresponding VM_FAULT_* code in several places,
but this is getting confusing, so Set the VM_FAULT_* codes directly
instead. (No change in functionality.)
Signed-off-by: Andreas Gruenbacher
---
fs
Hi,
On Tue, May 18, 2021 at 10:49 AM Hillf Danton wrote:
> When put, glock is removed from lru by calling gfs2_glock_remove_from_lru()
> in __gfs2_glock_put(), and check GLF_LRU under lru_lock.
>
> On the shrink scan path, GLF_LRU is cleared under lru_lock but because of
> cond_resched_lock(&lru_
On Tue, May 11, 2021 at 4:34 PM Matthew Wilcox wrote:
> On Tue, May 11, 2021 at 04:01:13PM +0200, Andreas Gruenbacher wrote:
> > we have a locking problem in gfs2 that I don't have a proper solution for,
> > so
> > I'm looking for suggestions.
> >
>
Hello,
we have a locking problem in gfs2 that I don't have a proper solution for, so
I'm looking for suggestions.
What's happening is that a page fault triggers during a read or write
operation, while we're holding a glock (the cluster-wide gfs2 inode
lock), and the page fault requires another gl
.org # v5.8+
Signed-off-by: Andreas Gruenbacher
---
fs/gfs2/file.c | 14 +-
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 3ebc9af39a04..658fed79d65a 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -538,18 +538,22 @@ static vm_fa
401 - 500 of 1584 matches
Mail list logo