[Cluster-devel] [GFS2 PATCH 4/6] gfs2: introduce new gfs2_glock_assert_withdraw

2020-06-05 Thread Bob Peterson
Before this patch, asserts based on glocks did not print the glock with the error. This patch introduces a new macro, gfs2_glock_assert_withdraw which first prints the glock, then takes the assert. This also changes a few glock asserts to the new macro. Signed-off-by: Bob Peterson --- fs/gfs2/g

[Cluster-devel] [GFS2 PATCH 1/6] gfs2: Add new sysfs file for gfs2 status

2020-06-05 Thread Bob Peterson
This patch adds a new file: /sys/fs/gfs2/*/status which will report the status of the file system. Catting this file dumps the current status of the file system according to various superblock variables. For example: Journal Checked: 1 Journal Live: 1 Withdrawn: 0 No barriers:

[Cluster-devel] [GFS2 PATCH 6/6] gfs2: fix use-after-free on transaction ail lists

2020-06-05 Thread Bob Peterson
Before this patch, transactions could be merged into the system transaction by function gfs2_merge_trans(), but then it is not considered attached. The caller, log_refund, only sets TR_ATTACHED if the transaction is not merged. Later, in function, gfs2_trans_end, if TR_ATTACHED is not set (because

Re: [Cluster-devel] [PATCH 6/8] gfs2: instrumentation wrt log_flush stuck

2020-06-05 Thread Bob Peterson
Hi Andreas, - Original Message - (snip) > > @@ -970,7 +969,16 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct > > gfs2_glock *gl, u32 flags) > > > > if (!(flags & GFS2_LOG_HEAD_FLUSH_NORMAL)) { > > if (!sdp->sd_log_idle) { > > + unsigned lo

Re: [Cluster-devel] [PATCH 6/8] gfs2: instrumentation wrt log_flush stuck

2020-06-05 Thread Andreas Gruenbacher
On Fri, Jun 5, 2020 at 4:49 PM Bob Peterson wrote: > Hi Andreas, > > - Original Message - > (snip) > > > @@ -970,7 +969,16 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct > > > gfs2_glock *gl, u32 flags) > > > > > > if (!(flags & GFS2_LOG_HEAD_FLUSH_NORMAL)) { > > >

[Cluster-devel] [GFS2 PATCH 5/6] gfs2: new slab for transactions

2020-06-05 Thread Bob Peterson
This patch adds a new slab for gfs2 transactions. That allows us to have an initialization function and protect against some errors. Signed-off-by: Bob Peterson --- fs/gfs2/glops.c | 2 ++ fs/gfs2/log.c | 9 + fs/gfs2/main.c | 9 + fs/gfs2/trans.c | 22 ++---

[Cluster-devel] [GFS2 PATCH 0/6 v2] Misc Patch Collection

2020-06-05 Thread Bob Peterson
I've revised my recent patch set based on feedback from Andreas. Here is my latest. Changes from last time are: 1. Removed the spin_trylock related info from the status sysfs file as per Andreas's feedback. Although valuable to have, I see his point. 2. Removed "gfs2: Add new trace point for gl

Re: [Cluster-devel] [PATCH 7/8] gfs2: Add new trace point for glock ail management

2020-06-05 Thread Andreas Gruenbacher
Bob, this very much looks like a debugging trace point that has no business in production code. Thanks, Andreas

[Cluster-devel] [GFS2 PATCH v3] gfs2: new slab for transactions

2020-06-05 Thread Bob Peterson
Hi, I revised the patch description for Andreas: This patch adds a new slab for gfs2 transactions. That allows us to reduce kernel memory fragmentation, have better organization of data for analysis of vmcore dumps. A new centralized function is added to free the slab objects, and it exposes use-

Re: [Cluster-devel] [PATCH 6/8] gfs2: instrumentation wrt log_flush stuck

2020-06-05 Thread Bob Peterson
- Original Message - > On Fri, Jun 5, 2020 at 4:49 PM Bob Peterson wrote: > > Hi Andreas, > > > > - Original Message - > > (snip) > > > > @@ -970,7 +969,16 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct > > > > gfs2_glock *gl, u32 flags) > > > > > > > > if (!(flags & G

Re: [Cluster-devel] [PATCH 6/8] gfs2: instrumentation wrt log_flush stuck

2020-06-05 Thread Andreas Gruenbacher
On Fri, Jun 5, 2020 at 6:15 PM Bob Peterson wrote: > - Original Message - > > On Fri, Jun 5, 2020 at 4:49 PM Bob Peterson wrote: > > > Hi Andreas, > > > > > > - Original Message - > > > (snip) > > > > > @@ -970,7 +969,16 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct > > > >

Re: [Cluster-devel] [PATCH 6/8] gfs2: instrumentation wrt log_flush stuck

2020-06-05 Thread Andreas Gruenbacher
Hi Bob, On Tue, May 26, 2020 at 3:05 PM Bob Peterson wrote: > This adds checks for gfs2_log_flush being stuck, similarly to the check > in gfs2_ail1_flush. > > Signed-off-by: Bob Peterson > --- > fs/gfs2/log.c | 14 +++--- > 1 file changed, 11 insertions(+), 3 deletions(-) > > diff --gi

Re: [Cluster-devel] [PATCH 0/8] Misc Patch Collection

2020-06-05 Thread Andreas Gruenbacher
Hi Bob, On Tue, May 26, 2020 at 3:07 PM Bob Peterson wrote: > Andreas expressed some concerns about some of the others. For example, he > didn't like that the new "status" sysfs file was taking "try" locks, but > if the lock is held, I don't know of a better way to do this. walking a linked list

[Cluster-devel] [GFS2 PATCH 2/6] gfs2: print mapping->nrpages in glock dump for address space glocks

2020-06-05 Thread Bob Peterson
This patch makes the glock dumps in debugfs print the number of pages (nrpages) for address space glocks. This will aid in debugging. Signed-off-by: Bob Peterson --- fs/gfs2/glock.c | 25 - 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/fs/gfs2/glock.c b/f

[Cluster-devel] [GFS2 PATCH 3/6] gfs2: instrumentation wrt log_flush stuck

2020-06-05 Thread Bob Peterson
This adds checks for gfs2_log_flush being stuck, similarly to the check in gfs2_ail1_flush. To faciliate this and make the strings easy to grep we move the ail1 emptying to its own function, empty_ail1_list. Signed-off-by: Bob Peterson --- fs/gfs2/log.c | 34 +- 1

[Cluster-devel] [GFS2 PATCH v2] gfs2: new slab for transactions

2020-06-05 Thread Bob Peterson
Hi, I've posted similar patches for this in the past, but they all had shortcomings. This is my latest version. There is a follow-on patch which I will post shortly. In the future, I want to add a new slab initialization function, but for now this is enough. Note that the use-after-free warnings

[Cluster-devel] [PATCH AUTOSEL 5.4 10/14] gfs2: Even more gfs2_find_jhead fixes

2020-06-05 Thread Sasha Levin
From: Andreas Gruenbacher [ Upstream commit 20be493b787cd581c9fffad7fcd6bfbe6af1050c ] Fix several issues in the previous gfs2_find_jhead fix: * When updating @blocks_submitted, @block refers to the first block block not submitted yet, not the last block submitted, so fix an off-by-one error.

[Cluster-devel] [PATCH AUTOSEL 5.6 12/17] gfs2: Even more gfs2_find_jhead fixes

2020-06-05 Thread Sasha Levin
From: Andreas Gruenbacher [ Upstream commit 20be493b787cd581c9fffad7fcd6bfbe6af1050c ] Fix several issues in the previous gfs2_find_jhead fix: * When updating @blocks_submitted, @block refers to the first block block not submitted yet, not the last block submitted, so fix an off-by-one error.

[Cluster-devel] [gfs2 patch] gfs2: fix use-after-free on transaction ail lists

2020-06-05 Thread Bob Peterson
Hi, Before this patch, transactions could be merged into the system transaction by function gfs2_merge_trans(), but then it is not considered attached. The caller, log_refund, only sets TR_ATTACHED if the transaction is not merged. Later, in function, gfs2_trans_end, if TR_ATTACHED is not set (bec