Re: [Cluster-devel] [PATCH] gfs2: Fix uaf for qda in gfs2_quota_sync

2023-08-22 Thread Bob Peterson
torage media. If possible I'd like to know how you cause this problem to occur. What were you doing to get this to happen? And how can I recreate it? GFS2 might have a problem with withdrawing during this sequence, but I don't think it has much to do with the sd_quota_bitmap. Regards, Bob Peterson GFS2 File System

Re: [Cluster-devel] [syzbot] [gfs2?] kernel panic: hung_task: blocked tasks (2)

2023-07-28 Thread Bob Peterson
r gets stuck for a long period of time it is supposed to dump the remaining list of glocks that still have not been resolved. I think it takes 10 minutes or so. Can you post the console messages that follow? That will help us figure out what's happening. Thanks. Regards, Bob Peterson

Re: [Cluster-devel] [syzbot] [gfs2?] KASAN: use-after-free Read in qd_unlock (2)

2023-07-26 Thread Bob Peterson
://goo.gl/tpsmEJ#bisection The bisect is very likely to be wrong. I have a lot of patches to gfs2's quota code in linux-gfs2/bobquota that I hope to get into the next merge window, but the critical patch has already been merged. I'm still working on others. Regards, Bob Peterson gfs2 file system

Re: [Cluster-devel] allow building a kernel without buffer_heads

2023-07-20 Thread Bob Peterson
large and daunting task. We can still work toward that goal, but it will take time. Bob Peterson

Re: [Cluster-devel] [PATCH 0/6] gfs2/buffer folio changes

2023-06-02 Thread Bob Peterson
On 6/2/23 7:30 AM, Bob Peterson wrote: On 5/16/23 10:24 PM, Matthew Wilcox (Oracle) wrote: This kind of started off as a gfs2 patch series, then became entwined with buffer heads once I realised that gfs2 was the only remaining caller of __block_write_full_page().  For those not in the gfs2

Re: [Cluster-devel] [PATCH 0/6] gfs2/buffer folio changes

2023-06-02 Thread Bob Peterson
If you want you can add: Tested-by: Bob Peterson Reviewed-by: Bob Peterson Regards, Bob Peterson

Re: [Cluster-devel] [PATCH 0/6] gfs2/buffer folio changes

2023-05-17 Thread Bob Peterson
ow how it fares. Regards, Bob Peterson

[Cluster-devel] [PATCH] gfs2: Fix gfs2_qa_get imbalance in gfs2_quota_hold

2023-05-15 Thread Bob Peterson
This patch fixes a case in which function gfs2_quota_hold encounters an assert error and exits. The lack of gfs2_qa_put causes further problems when the inode is evicted and the get/put count is non-zero. Signed-off-by: Bob Peterson --- fs/gfs2/quota.c | 1 + 1 file changed, 1 insertion

Re: [Cluster-devel] [PATCH] gfs2: Don't free rgrp clone bitmaps until go_inval

2023-05-11 Thread Bob Peterson
ls. But still, it seems to work properly. I had a meeting with Andreas this morning and we decided that since it seems to work, "if it's not broken, don't fix it." So for now, I retract the patch and we can readdress the issue if we find problems related to it. Regards, Bob Peterson

[Cluster-devel] [PATCH] gfs2: Don't free rgrp clone bitmaps until go_inval

2023-05-10 Thread Bob Peterson
7. Go to 1. Other transitions, like EX->UN still sync and free the clone bitmaps. And, of course, transition from SH->EX cannot have dirty buffers, so will not have clone bitmaps. Signed-off-by: Bob Peterson --- fs/gfs2/glops.c | 4 +++- fs/gfs2/rgrp.c | 13 + fs/gfs2/rgrp.h |

Re: [Cluster-devel] [PATCH] gfs2: ignore rindex_update failure in dinode_dealloc

2023-05-05 Thread Bob Peterson
this code path. Errors like -EIO may prevent further reads or writes to the file system, its metadata, etc., in other places but that should be flagged up by other processes and hopefully gfs2's recovery, journal replays, etc., will ensure file system integrity. Regards, Bob Peterson

Re: [Cluster-devel] [PATCH] gfs2: ignore rindex_update failure in dinode_dealloc

2023-05-05 Thread Bob Peterson
Hi Andy, On 5/5/23 3:44 AM, Andrew Price wrote: Hi Bob, On 04/05/2023 18:43, Bob Peterson wrote: Before this patch function gfs2_dinode_dealloc would abort if it got a bad return code from gfs2_rindex_update. The problem is that it left the dinode in the unlinked (not free) state, which meant

[Cluster-devel] [PATCH] gfs2: ignore rindex_update failure in dinode_dealloc

2023-05-04 Thread Bob Peterson
herefore the error should not prevent the transition from unlinked to free. This patch makes gfs2_dinode_dealloc ignore the bad return code and proceed with freeing the dinode so the QE tests will not be tripped up. Signed-off-by: Bob Peterson --- fs/gfs2/super.c | 4 +--- 1 file changed, 1

Re: [Cluster-devel] [PATCH v5 09/20] gfs2: use __bio_add_page for adding single page to bio

2023-05-02 Thread Bob Peterson
gfs2. Why change this particular bio_add_page() to __bio_add_page() and not the other five? Regards, Bob Peterson

[Cluster-devel] [PATCH] gfs2: Don't deref jdesc in evict

2023-04-28 Thread Bob Peterson
check for sdp->sd_jdesc to function gfs2_evict_inode. In theory, this should only happen to corrupt gfs2 file systems, when gfs2 detects the problem, reports it, then tries to evict all the system inodes it has read in up to that point. Reported-by: Yang Lan Signed-off-by: Bob Peterson --- f

Re: [Cluster-devel] We found a general protection fault in evict

2023-04-27 Thread Bob Peterson
ready fixed in newer versions, but I don't have easy access to that kernel. Perhaps you can bisect it? I could try older kernels but I've already spent a lot of time on this today, so I need to move on to other things. Regards, Bob Peterson

[Cluster-devel] [PATCH] gfs2: fix minor comment typos

2023-04-26 Thread Bob Peterson
Signed-off-by: Bob Peterson --- fs/gfs2/bmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index c739b258a2d9..8d611fbcf0bd 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -1729,8 +1729,8 @@ static int punch_hole(struct gfs2_inode

[Cluster-devel] [PATCH] gfs2: simplify gdlm_put_lock with out_free label

2023-04-25 Thread Bob Peterson
No change in function. This patch introduces a new label out_free and consolidates the three places function gdlm_put_lock freed the glock. Signed-off-by: Bob Peterson --- fs/gfs2/lock_dlm.c | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/fs/gfs2

[Cluster-devel] [PATCH] gfs2: Don't free rgrp clone bitmaps until go_inval

2023-04-25 Thread Bob Peterson
7. Go to 1. Other transitions, like EX->UN still sync and free the clone bitmaps. And, of course, transition from SH->EX cannot have dirty buffers, so will not have clone bitmaps. Signed-off-by: Bob Peterson --- fs/gfs2/glops.c | 5 - fs/gfs2/rgrp.c | 13 + fs/gfs2/rgrp.h |

Re: [Cluster-devel] [GFS2 PATCH 2/4] gfs2: Perform second log flush in gfs2_make_fs_ro

2023-04-24 Thread Bob Peterson
, Bob Peterson

[Cluster-devel] [GFS2 PATCH 4/4] gfs2: gfs2_ail_empty_gl no log flush on error

2023-04-21 Thread Bob Peterson
consistency. Signed-off-by: Bob Peterson --- fs/gfs2/glops.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c index 4b3949f2020b..ef31218060aa 100644 --- a/fs/gfs2/glops.c +++ b/fs/gfs2/glops.c @@ -132,8 +132,9 @@ static int gfs2_ail_empty_gl

[Cluster-devel] [GFS2 PATCH 2/4] gfs2: Perform second log flush in gfs2_make_fs_ro

2023-04-21 Thread Bob Peterson
ond log_flush to gfs2_make_fs_ro: one to sync the data and one to sync any outstanding revokes and finalize the journal. Note that both of these log flushes need to be "special," in other words, not GFS2_LOG_HEAD_FLUSH_NORMAL. Signed-off-by: Bob Peterson --- fs/gfs2/super.c | 9 +

[Cluster-devel] [GFS2 PATCH 3/4] gfs2: Issue message when revokes cannot be written

2023-04-21 Thread Bob Peterson
. Signed-off-by: Bob Peterson --- fs/gfs2/glops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c index 8e245d793e6b..4b3949f2020b 100644 --- a/fs/gfs2/glops.c +++ b/fs/gfs2/glops.c @@ -127,6 +127,8 @@ static int gfs2_ail_empty_gl(struct gfs2_glock *gl

[Cluster-devel] [GFS2 PATCH 1/4] gfs2: return errors from gfs2_ail_empty_gl

2023-04-21 Thread Bob Peterson
that their lvb values were correct, but in fact corresponded to the glock without its revokes properly synced. That presented as lvb mismatch errors. This patch allows gfs2_ail_empty_gl to return the error properly to the caller. Signed-off-by: Bob Peterson --- fs/gfs2/glops.c | 16

[Cluster-devel] [GFS2 PATCH 0/4] Fix revoke processing at unmount and ro

2023-04-21 Thread Bob Peterson
This series of patches fixes a set of corner cases regarding how revokes are handled during unmount and transitions to read-only. Return codes were dropped, errors were not reported, and revokes were not written properly. Bob Peterson (4): gfs2: return errors from gfs2_ail_empty_gl gfs2

[Cluster-devel] [PATCH] gfs2: Use gfs2_holder_initialized for jindex

2023-04-10 Thread Bob Peterson
variable in favor of using function gfs2_holder_initialized. Signed-off-by: Bob Peterson --- fs/gfs2/ops_fstype.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 6de901c3b89b..9af9ddb61ca0 100644 --- a/fs/gfs2/ops_fstype.c

[Cluster-devel] [PATCH] gfs2: Eliminate gfs2_trim_blocks

2023-04-07 Thread Bob Peterson
Function gfs2_trim_blocks is not referenced. Eliminate it. Signed-off-by: Bob Peterson --- fs/gfs2/bmap.c | 8 fs/gfs2/bmap.h | 1 - 2 files changed, 9 deletions(-) diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index eedf6926c652..c739b258a2d9 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2

[Cluster-devel] [PATCH] Revert "Revert "GFS2: free disk inode which is deleted by remote node -V2""

2023-03-23 Thread Bob Peterson
It turns out that reverting 970343cd4904 causes a regression related to evicting inodes that were unlinked on a different cluster node. We could also have simply added a call to d_mark_dontcache to function gfs2_try_evict but the original pre-revert code is better tested and proven. This reverts

[Cluster-devel] [PATCH] gfs2: Register fs after creating workqueues

2022-08-30 Thread Bob Peterson
only registers the file system after the work queues are created. Signed-off-by: Bob Peterson --- fs/gfs2/main.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c index 14ae9de76277..afcb32854f14 100644 --- a/fs/gfs2/m

[Cluster-devel] [PATCH] gfs2: Use TRY lock in gfs2_inode_lookup for UNLINKED inodes

2022-08-25 Thread Bob Peterson
, change function gfs2_inode_lookup() so that when GFS2_BLKST_UNLINKED inodes are searched, it uses the LM_FLAG_TRY flag for the iopen glock. If the locking request fails, fail gfs2_inode_lookup() with -EAGAIN so that delete_work_func() can retry the operation later. Signed-off-by: Bob Peterson

[Cluster-devel] [GFS2 v3 PATCH 2/3] gfs2: Dequeue waiters when withdrawn

2022-08-18 Thread Bob Peterson
-minute timeout period. This patch takes measures to remove any pending waiters from the glocks that will never be granted. This allows the unmount to proceed in a reasonable period of time. Signed-off-by: Bob Peterson --- fs/gfs2/glock.c | 14 ++ fs/gfs2/glock.h | 1 + fs/gfs2

[Cluster-devel] [GFS2 v3 PATCH 1/3] gfs2: Prevent double iput for journal on error

2022-08-18 Thread Bob Peterson
s, it would do a second iput referencing the pointer. To avoid this, set the inode pointer to NULL. Signed-off-by: Bob Peterson --- fs/gfs2/util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/gfs2/util.c b/fs/gfs2/util.c index 8241029a2a5d..95c79a3ec161 100644 --- a/fs/gfs2/util.c +++ b/fs

[Cluster-devel] [GFS2 v3 PATCH 0/3] gfs2: Misc withdraw patches (version 3)

2022-08-18 Thread Bob Peterson
. Unmount would similarly hang when the withdraw prevented an outgoing request to dlm, but so the glock was never unlocked. Bob Peterson (3): gfs2: Prevent double iput for journal on error gfs2: Dequeue waiters when withdrawn gfs2: Clear flags when withdraw prevents xmote fs/gfs2/glock.c

[Cluster-devel] [GFS2 v3 PATCH 3/3] gfs2: Clear flags when withdraw prevents xmote

2022-08-18 Thread Bob Peterson
causes us to skip the majority of do_xmote, it therefore also skips the call to finish_xmote() so the DEMOTE_IN_PROGRESS flag needs to be cleared manually. Signed-off-by: Bob Peterson --- fs/gfs2/glock.c | 22 -- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/fs

[Cluster-devel] [PATCH v2 0/3] gfs2: Misc withdraw patches

2022-08-02 Thread Bob Peterson
ueued that, due to the withdraw, could never be granted. 3. Unmount would similarly hang when the withdraw prevented an outgoing request to dlm, but so the glock was never unlocked. Bob Peterson (3): gfs2: Prevent double iput for journal on error gfs2: Dequeue waiters when withdrawn

[Cluster-devel] [PATCH 2/3] gfs2: Dequeue waiters when withdrawn

2022-08-02 Thread Bob Peterson
-minute timeout period. This patch takes measures to remove any pending waiters from the glocks that will never be granted. This allows the unmount to proceed in a reasonable period of time. Signed-off-by: Bob Peterson --- fs/gfs2/glock.c | 14 ++ fs/gfs2/glock.h | 1 + fs/gfs2

[Cluster-devel] [PATCH 1/3] gfs2: Prevent double iput for journal on error

2022-08-02 Thread Bob Peterson
s, it would do a second iput referencing the pointer. To avoid this, set the journal inode pointer to NULL. Signed-off-by: Bob Peterson --- fs/gfs2/util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/gfs2/util.c b/fs/gfs2/util.c index 8241029a2a5d..95c79a3ec161 100644 --- a/fs/gfs2/util.c

[Cluster-devel] [PATCH 3/3] gfs2: Clear GLF_LOCK when withdraw prevents xmote

2022-08-02 Thread Bob Peterson
causes us to skip the majority of do_xmote, it therefore also skips the call to finish_xmote() so the DEMOTE_IN_PROGRESS flag needs to be cleared manually as well. Signed-off-by: Bob Peterson --- fs/gfs2/glock.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a

[Cluster-devel] [PATCH 1/3] gfs2: Prevent double iput for journal on error

2022-07-27 Thread Bob Peterson
e the journal descriptor from the list when it cannot get a replacement inode. So unmount won't find it on the list and try to iput it again. Signed-off-by: Bob Peterson --- fs/gfs2/util.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/fs/gfs2/util.c b/fs/gfs2/util.c index 82

[Cluster-devel] [PATCH 2/3] gfs2: Dequeue waiters when withdrawn

2022-07-27 Thread Bob Peterson
When a withdraw occurs, ordinary (not system) glocks may not be granted anymore. This patch takes measures to remove any pending waiters from the glocks that will never be granted. Signed-off-by: Bob Peterson --- fs/gfs2/glock.c | 14 ++ fs/gfs2/glock.h | 1 + fs/gfs2/util.c | 5

[Cluster-devel] [PATCH 0/3] Misc withdraw patches

2022-07-27 Thread Bob Peterson
request to dlm, but so the glock was never unlocked. Bob Peterson (3): gfs2: Prevent double iput for journal on error gfs2: Dequeue waiters when withdrawn gfs2: Clear GLF_LOCK when withdraw prevents xmote fs/gfs2/glock.c | 33 - fs/gfs2/glock.h | 1 + fs

[Cluster-devel] [PATCH 3/3] gfs2: Clear GLF_LOCK when withdraw prevents xmote

2022-07-27 Thread Bob Peterson
causes us to skip the majority of do_xmote, it therefore also skips the call to finish_xmote() so the DEMOTE_IN_PROGRESS flag needs to be cleared manually. Signed-off-by: Bob Peterson --- fs/gfs2/glock.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/fs/gfs2

[Cluster-devel] [PATCH] gfs2: Remove return value for gfs2_indirect_init

2022-03-03 Thread Bob Peterson
The return value from function gfs2_indirect_init is never used, so remove it. Signed-off-by: Bob Peterson --- fs/gfs2/bmap.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index fbdb7a30470a..39080b2d6cf8 100644 --- a/fs/gfs2/bmap.c

[Cluster-devel] [PATCH] gfs2: Move iomap_get before taking sd_quota_mutex

2022-02-11 Thread Bob Peterson
g the mutex) the iomap_get was wasted time, so return. The case in which it wastes time (step 4) should be very rare and only occur when sd_quota_mutex is contended. But this avoids the ABBA deadlock. Signed-off-by: Bob Peterson --- fs/gfs2/quota.c | 39 +++--

[Cluster-devel] [PATCH] gfs2: Convert function bh_get to use iomap

2022-02-11 Thread Bob Peterson
Before this patch, function bh_get used block_map to figure out the block it needed to read in from the quota_change file. This patch changes it to use iomap directly to make it more efficient. Signed-off-by: Bob Peterson --- fs/gfs2/quota.c | 15 +++ 1 file changed, 11 insertions

[Cluster-devel] [PATCH] gfs2: use i_lock spin_lock for inode qadata

2022-02-11 Thread Bob Peterson
opens (gfs2_open -> gfs2_open_common -> gfs2_qa_get) can then stomp on each others values for i_qadata. This patch solves the conflict by using the i_lock spin_lock in the inode to prevent simultaneous access. Signed-off-by: Bob Peterson --- fs/gfs2/quota.c | 32 -

Re: [Cluster-devel] [PATCH] gfs2: Expect -EBUSY after canceling dlm locking requests

2022-02-02 Thread Bob Peterson
fs_err(sdp, "gdlm_unlock %x,%llx err=%d\n", gl->gl_name.ln_type, Hi, Looks good. If you push it to a temp branch I'll test it. Bob Peterson

[Cluster-devel] [GFS2 PATCH 1/3] gfs2: cancel timed-out glock requests

2022-01-24 Thread Bob Peterson
gfs2. Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson --- fs/gfs2/glock.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index b7ab8430333c..78b0dc04c38a 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -672,6 +672,8

[Cluster-devel] [GFS2 PATCH 0/3] Fix how gfs2 handles timed-out dlm requests

2022-01-24 Thread Bob Peterson
ed solution, we need to retry the request. Andreas Gruenbacher (2): gfs2: cancel timed-out glock requests gfs2: Switch lock order of inode and iopen glock Bob Peterson (1): gfs2: Retry on dlm -EBUSY (stop gap) fs/gfs2/glock.c| 11 +++ fs/gfs2/

[Cluster-devel] [GFS2 PATCH 3/3] gfs2: Switch lock order of inode and iopen glock

2022-01-24 Thread Bob Peterson
: Bob Peterson --- fs/gfs2/inode.c | 49 +++-- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 89905f4f29bb..b30ff50d17f3 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -131,7 +131,21

[Cluster-devel] [GFS2 PATCH 2/3] gfs2: Retry on dlm -EBUSY (stop gap)

2022-01-24 Thread Bob Peterson
measure until dlm has a solution in place. Signed-off-by: Bob Peterson --- fs/gfs2/lock_dlm.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/fs/gfs2/lock_dlm.c b/fs/gfs2/lock_dlm.c index 50578f881e6d..bf03c77b6757 100644 --- a/fs/gfs2/lock_dlm.c +++ b/fs

[Cluster-devel] [PATCH] gfs2: Change more BUG_ON to GLOCK_BUG_ON

2022-01-24 Thread Bob Peterson
This patch changes some BUG_ON calls to GLOCK_BUG_ON so we get more information to help with debugging when reservation problems occur. Signed-off-by: Bob Peterson --- fs/gfs2/rgrp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index

[Cluster-devel] [PATCH] gfs2: assign rgrp glock before compute_bitstructs

2022-01-17 Thread Bob Peterson
ered, the glock must also be put, so a new goto and label were added. Signed-off-by: Bob Peterson Reported-by: syzbot+c6fd14145e2f62ca0...@syzkaller.appspotmail.com --- fs/gfs2/rgrp.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgr

[Cluster-devel] [PATCH] gfs2: tell dlm to cancel timed out iopen locks

2022-01-07 Thread Bob Peterson
he cancel AST should be relatively quick and guaranteed, so should never result in deadlock. Signed-off-by: Bob Peterson --- fs/gfs2/glock.c | 5 + fs/gfs2/incore.h | 1 + fs/gfs2/super.c | 14 +- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/fs/gfs2/gloc

[Cluster-devel] [PATCH] gfs2: zero out all rgrp lvbs after recovery

2021-11-12 Thread Bob Peterson
her node's journal, so it has no way to know if its lvbs are still valid. So as soon as it knows recovery is complete and the journals have been properly replayed, it zeroes out the lvbs for all rgrp glocks. This forces it to re-read the lvb the next time the glock is held. Signed-off-by: Bob Pe

[Cluster-devel] [PATCH] gfs2: remove redundant set of INSTANTIATE_NEEDED

2021-11-12 Thread Bob Peterson
Function rgrp_go_inval calls gfs2_rgrp_brelse to invalidate the in-core rgrp structures. After the call it set GLF_INSTANTIATE_NEEDED, which is redundant, since gfs2_rgrp_brelse also sets it. This patch simply removes the redundant set_bit. Signed-off-by: Bob Peterson --- fs/gfs2/glops.c | 1

Re: [Cluster-devel] [PATCH v8 00/17] gfs2: Fix mmap + page fault deadlocks

2021-10-19 Thread Bob Peterson
xtensively, although only with gfs2. I've tested it with numerous scenarios, both stand-alone (xfstests as well as several other test programs I have in my collection) and in a cluster with some very heavy duty cluster coherency tests. My testing is nearly complete, but not quite. Regards, Bob Pet

[Cluster-devel] [GFS2 v3 PATCH 13/13] gfs2: set glock object after nq

2021-10-11 Thread Bob Peterson
ction can take place. This patch moves the call to glock_set_object until after the glock is acquire in function gfs2_create_inode, so it waits for possibly competing evicts to finish their processing first. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher --- fs/gfs2/inode.

[Cluster-devel] [GFS2 v3 PATCH 10/13] gfs2: fix GL_SKIP node_scope problems

2021-10-11 Thread Bob Peterson
in because the other process's go_instantiate operation may not have been successful. Functions that previously called the instantiate sub-functions now call directly into gfs2_instantiate so the new bits are managed properly. Signed-off-by: Bob Peterson Signed-off-by: Andreas Grue

[Cluster-devel] [GFS2 v3 PATCH 05/13] gfs2: change go_lock to go_instantiate

2021-10-11 Thread Bob Peterson
Before this patch, the go_lock glock operations (glops) did not do any actual locking. They were used to instantiate objects, like reading in dinodes and rgrps from the media. This patch renames the functions to go_instantiate for clarity. Signed-off-by: Bob Peterson Signed-off-by: Andreas

[Cluster-devel] [GFS2 v3 PATCH 12/13] gfs2: remove RDF_UPTODATE flag

2021-10-11 Thread Bob Peterson
The new GLF_INSTANTIATE_NEEDED flag obsoletes the old rgrp flag GFS2_RDF_UPTODATE, so this patch replaces it like we did with inodes. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher --- fs/gfs2/glops.c | 2 +- fs/gfs2/incore.h | 1 - fs/gfs2/rgrp.c | 36

[Cluster-devel] [GFS2 v3 PATCH 11/13] gfs2: Eliminate GIF_INVALID flag

2021-10-11 Thread Bob Peterson
With the addition of the new GLF_INSTANTIATE_NEEDED flag, the GIF_INVALID flag is now redundant. This patch removes it. Since inode_instantiate is only called when instantiation is needed, the check in inode_instantiate is removed too. Signed-off-by: Bob Peterson Signed-off-by: Andreas

[Cluster-devel] [GFS2 v3 PATCH 09/13] gfs2: split glock instantiation off from do_promote

2021-10-11 Thread Bob Peterson
Before this patch, function do_promote had a section of code that did the actual instantiation. This patch splits that off into its own function, gfs2_instantiate, which prepares us for the next patch that will use that function. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher

[Cluster-devel] [GFS2 v3 PATCH 07/13] gfs2: re-factor function do_promote

2021-10-11 Thread Bob Peterson
This patch simply re-factors function do_promote to reduce the indents. The logic should be unchanged. This makes future patches more readable. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher --- fs/gfs2/glock.c | 51 - 1 file

[Cluster-devel] [GFS2 v3 PATCH 08/13] gfs2: further simplify do_promote

2021-10-11 Thread Bob Peterson
This patch further simplifies function do_promote by eliminating some redundant code in favor of using a lock_released flag. This is just prep work for a future patch. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher --- fs/gfs2/glock.c | 41

[Cluster-devel] [GFS2 v3 PATCH 01/13] gfs2: Allow append and immutable bits to coexist

2021-10-11 Thread Bob Peterson
error. This bug caused xfstests generic/545 to fail. This patch simply removes the invalid checks. I also eliminated an unused parm from do_gfs2_set_flags. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher --- fs/gfs2/file.c | 10 ++ 1 file changed, 2 insertions(+), 8 dele

[Cluster-devel] [GFS2 v3 PATCH 03/13] gfs2: dequeue iopen holder in gfs2_inode_lookup error

2021-10-11 Thread Bob Peterson
calls gfs2_evict_inode -> evict_should_delete. It blocks trying to lock the inode glock, which is now held by node B. This patch introduces error handling to function gfs2_inode_lookup so it properly dequeues held iopen glocks on errors. Signed-off-by: Bob Peterson Signed-off-by

[Cluster-devel] [GFS2 v3 PATCH 04/13] gfs2: dump glocks from gfs2_consist_OBJ_i

2021-10-11 Thread Bob Peterson
Before this patch, failed consistency checks printed out the object that failed, but not the object's glock. This patch makes it also print out the object glock so we can see the glock's holders and flags to aid with debugging. Signed-off-by: Bob Peterson Signed-off-by: Andreas G

[Cluster-devel] [GFS2 v3 PATCH 02/13] gfs2: Save ip from gfs2_glock_nq_init

2021-10-11 Thread Bob Peterson
the function so that it saves gh_ip from the caller of gfs2_glock_nq_init, which makes it easy to backtrack which holder took the lock. Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson --- fs/gfs2/glock.c | 8 fs/gfs2/glock.h | 13 ++--- 2 files changed, 14

[Cluster-devel] [GFS2 v3 PATCH 06/13] gfs2: Remove 'first' trace_gfs2_promote argument

2021-10-11 Thread Bob Peterson
From: Andreas Gruenbacher Remove the 'first' argument of trace_gfs2_promote: with GL_SKIP, the 'first' holder isn't the one that instantiates the glock (gl_instantiate), which is what the 'first' flag was apparently supposed to indicate. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/glock.c

[Cluster-devel] [GFS2 v3 PATCH 00/13] gfs2: fix bugs related to node_scope and go_lock

2021-10-11 Thread Bob Peterson
cher (2): gfs2: Save ip from gfs2_glock_nq_init gfs2: Remove 'first' trace_gfs2_promote argument Bob Peterson (11): gfs2: Allow append and immutable bits to coexist gfs2: dequeue iopen holder in gfs2_inode_lookup error gfs2: dump glocks from gfs2_consist_OBJ_i gfs2: change go_lock to g

Re: [Cluster-devel] WARNING in __set_page_dirty

2021-10-06 Thread Bob Peterson
io, which does indeed make that assumption. While we ponder the problem, it seems to cause no harm unless you have lockdep set, so it's never been our highest priority to fix. Regards, Bob Peterson GFS2 File System

Re: [Cluster-devel] [PATCH] gfs2: Save caller ip in gfs2_glock_nq_init

2021-09-29 Thread Bob Peterson
On 9/29/21 9:47 AM, Andreas Gruenbacher wrote: Hi Bob, On Wed, Sep 29, 2021 at 3:16 PM Bob Peterson wrote: Before this patch, when a glock was locked by function gfs2_glock_nq_init, it initializes the holder gh_ip (return address) as gfs2_glock_nq_init. That made it extremely difficult to

Re: [Cluster-devel] [PATCH] gfs2: fix GL_SKIP node_scope problems

2021-09-29 Thread Bob Peterson
On 9/29/21 8:21 AM, Bob Peterson wrote: Before this patch, when a glock was locked, the very first holder on the queue would unlock the lockref and call the go_lock glops function (if one existed), unless GL_SKIP was specified. When we introduced the new node-scope concept, we allowed multiple

[Cluster-devel] [PATCH] gfs2: fix GL_SKIP node_scope problems

2021-09-29 Thread Bob Peterson
alled directly into the object-read functions (gfs2_inode_refresh and gfs2_rgrp_bh_get respectively), but that never cleared the new GLF_GO_LOCK_NEEDED flag. This patch changes those functions so they call into the new gfs2_go_lock directly, which takes care of all that. Signed-off-by: Bob Pe

[Cluster-devel] [PATCH] gfs2: Save caller ip in gfs2_glock_nq_init

2021-09-29 Thread Bob Peterson
saves gh_ip from the caller of gfs2_glock_nq_init, which makes it easy to backtrack which holder took the lock. Signed-off-by: Bob Peterson --- fs/gfs2/glock.h | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/gfs2/glock.h b/fs/gfs2/glock.h index 699c5e95006a..8a09379dbf66 100644 --- a/fs/gfs2

Re: [Cluster-devel] [GFS2 PATCH v2 6/6] gfs2: introduce and use new glops go_lock_needed

2021-09-22 Thread Bob Peterson
On 9/22/21 6:57 AM, Andreas Gruenbacher wrote: On Thu, Sep 16, 2021 at 9:11 PM Bob Peterson wrote: Before this patch, when a glock was locked, the very first holder on the queue would unlock the lockref and call the go_lock glops function (if one exists), unless GL_SKIP was specified. When we

[Cluster-devel] [GFS2 PATCH v2 6/6] gfs2: introduce and use new glops go_lock_needed

2021-09-16 Thread Bob Peterson
nger needs to do the read, and continue on without penalty. fixes: 06e908cd9ead ("gfs2: Allow node-wide exclusive glock sharing") Signed-off-by: Bob Peterson --- fs/gfs2/glock.c | 30 +++--- fs/gfs2/glops.c | 16 +--- fs/gfs2/incore.h | 1 +

[Cluster-devel] [GFS2 PATCH v2 3/6] gfs2: move GL_SKIP check from glops to do_promote

2021-09-16 Thread Bob Peterson
his avoids having to unnecessarily unlock gl_lockref.lock only to re-lock it again. Signed-off-by: Bob Peterson --- fs/gfs2/glock.c | 26 ++ fs/gfs2/glops.c | 2 +- fs/gfs2/rgrp.c | 2 -- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/fs/gfs2/glock.c

[Cluster-devel] [GFS2 PATCH v2 4/6] gfs2: Switch some BUG_ON to GLOCK_BUG_ON for debug

2021-09-16 Thread Bob Peterson
. Signed-off-by: Bob Peterson --- fs/gfs2/rgrp.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 1fb66f6e6a0c..96b2fbed6bf1 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c @@ -1230,7 +1230,7 @@ static int gfs2_rgrp_bh_get(struct

[Cluster-devel] [GFS2 PATCH v2 5/6] gfs2: simplify do_promote and fix promote trace

2021-09-16 Thread Bob Peterson
will also be used in a future patch. Signed-off-by: Bob Peterson --- fs/gfs2/glock.c | 19 --- fs/gfs2/glock.h | 7 +++ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index b8248ceff3c3..4fcf340603e7 100644 --- a/fs/gfs2/glo

[Cluster-devel] [GFS2 PATCH v2 1/6] gfs2: remove redundant check in gfs2_rgrp_go_lock

2021-09-16 Thread Bob Peterson
Before this patch function gfs2_rgrp_go_lock checked if GL_SKIP and ar_rgrplvb were both true. However, GL_SKIP is only set for rgrps if ar_rgrplvb is true (see gfs2_inplace_reserve). This patch simply removes the redundant check. Signed-off-by: Bob Peterson --- fs/gfs2/rgrp.c | 3 +-- 1 file

[Cluster-devel] [GFS2 PATCH v2 2/6] gfs2: Add GL_SKIP holder flag to dump_holder

2021-09-16 Thread Bob Peterson
Somehow the GL_SKIP flag was missed when dumping glock holders. This patch adds it to function hflags2str. I added it at the end because I wanted Holder and Skip flags together to read "Hs" rather than "sH" to avoid confusion with "Shared" ("SH") holder stat

[Cluster-devel] [GFS2 PATCH v2 0/6] gfs2: fix bugs related to node_scope and go_lock

2021-09-16 Thread Bob Peterson
This set of patches contains a few clean-ups and a patch to fix a NULL Pointer dereference introduced by the new "node scope" patch 06e908cd9ead ("gfs2: Allow node-wide exclusive glock sharing"). Bob Peterson (6): gfs2: remove redundant check in gfs2_rgrp_go_lock gfs2: Add

[Cluster-devel] [GFS2 PATCH 3/4] gfs2: move GL_SKIP check from glops to do_promote

2021-09-13 Thread Bob Peterson
There are two main reasons for doing this: 1. For cases in the GL_SKIP is specified, it avoids having to unnecessarily unlock gl_lockref.lock only to re-lock it again. 2. This makes it a little easier to follow and understand the next patch which breaks up function do_promote. Signed-o

[Cluster-devel] [GFS2 PATCH 1/4] gfs2: remove redundant check in gfs2_rgrp_go_lock

2021-09-13 Thread Bob Peterson
Before this patch function gfs2_rgrp_go_lock checked if GL_SKIP and ar_rgrplvb were both true. However, GL_SKIP is only set for rgrps if ar_rgrplvb is true (see gfs2_inplace_reserve). This patch simply removes the redundant check. Signed-off-by: Bob Peterson --- fs/gfs2/rgrp.c | 3 +-- 1 file

[Cluster-devel] [GFS2 PATCH 2/4] gfs2: Add GL_SKIP holder flag to dump_holder

2021-09-13 Thread Bob Peterson
Somehow the GL_SKIP flag was missed when dumping glock holders. This patch adds it to function hflags2str. I added it at the end because I wanted Holder and Skip flags together to read "Hs" rather than "sH" to avoid confusion with "Shared" ("SH") holder stat

[Cluster-devel] [GFS2 PATCH 4/4] gfs2: rework go_lock mechanism for node_scope race

2021-09-13 Thread Bob Peterson
t" flag to the kernel trace. Fixes: 06e908cd9ead ("gfs2: Allow node-wide exclusive glock sharing") Signed-off-by: Bob Peterson --- fs/gfs2/glock.c | 81 fs/gfs2/glops.c | 1 + fs/gfs2/incore.h | 1 + fs/gfs2/rgrp.c | 1 + 4 files chan

[Cluster-devel] [GFS2 PATCH 0/4] gfs2: fix bugs related to node_scope and go_lock

2021-09-13 Thread Bob Peterson
This set of patches contains a few clean-ups and a patch to fix a NULL Pointer dereference introduced by the new "node scope" patch 06e908cd9ead ("gfs2: Allow node-wide exclusive glock sharing"). Bob Peterson (4): gfs2: remove redundant check in gfs2_rgrp_go_lock gfs2: Add

[Cluster-devel] [PATCH] gfs2: Allow append and immutable bits to coexist

2021-08-25 Thread Bob Peterson
error. This bug caused xfstests generic/545 to fail. This patch simply removes the invalid checks. I also eliminated an unused parm from do_gfs2_set_flags. Signed-off-by: Bob Peterson --- fs/gfs2/file.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/fs/gfs2/file.c

Re: [Cluster-devel] [GFS2 PATCH 1/3] gfs2: switch go_xmote_bh glop to pass gh not gl

2021-08-25 Thread Bob Peterson
On 8/24/21 5:27 PM, Andreas Gruenbacher wrote: On Tue, Aug 24, 2021 at 6:48 PM Bob Peterson wrote: On 8/24/21 11:12 AM, Andreas Gruenbacher wrote: On Tue, Aug 24, 2021 at 4:02 PM Bob Peterson wrote: Before this patch, the go_xmote_bh function was passed gl, the glock pointer. This patch

[Cluster-devel] [PATCH] gfs2: Fix broken freeze_go_xmote_bh

2021-08-24 Thread Bob Peterson
on if the journal is being transitioned from "not live" to "live": If it is becoming live, the check is needed, otherwise it is not. Signed-off-by: Bob Peterson --- fs/gfs2/glops.c | 31 --- fs/gfs2/ops_fstype.

Re: [Cluster-devel] [GFS2 PATCH 1/3] gfs2: switch go_xmote_bh glop to pass gh not gl

2021-08-24 Thread Bob Peterson
Hi, On 8/24/21 11:12 AM, Andreas Gruenbacher wrote: On Tue, Aug 24, 2021 at 4:02 PM Bob Peterson wrote: Before this patch, the go_xmote_bh function was passed gl, the glock pointer. This patch switches it to gh, the holder, which points to the gl. This facilitates improvements for the next

[Cluster-devel] [GFS2 PATCH 0/3] gfs2: Fix freeze/thaw journal check problems

2021-08-24 Thread Bob Peterson
This patch set fixes some problems in which the freeze glock's glop functions were not working as expected. Bob Peterson (3): gfs2: switch go_xmote_bh glop to pass gh not gl gfs2: Fix broken freeze_go_xmote_bh gfs2: Eliminate go_xmote_bh in favor of go_lock fs/gfs2/glock.c

[Cluster-devel] [GFS2 PATCH 2/3] gfs2: Fix broken freeze_go_xmote_bh

2021-08-24 Thread Bob Peterson
e check is required, they do not specify GL_SKIP. Most callers determine if the consistency check is needed based on if the journal is being transitioned from "not live" to "live": If it is becoming live, the check is needed, otherwise it is not. Signed-off-by:

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

2021-08-24 Thread Bob Peterson
, readability, etc. Using go_lock was previously not possible because of the bug fixed by the previous patch. I also fixed a misleading comment in do_promote. Signed-off-by: Bob Peterson --- fs/gfs2/glock.c | 12 +--- fs/gfs2/glops.c | 6 +++--- fs/gfs2/incore.h | 1 - 3 files changed, 4

[Cluster-devel] [GFS2 PATCH 1/3] gfs2: switch go_xmote_bh glop to pass gh not gl

2021-08-24 Thread Bob Peterson
Before this patch, the go_xmote_bh function was passed gl, the glock pointer. This patch switches it to gh, the holder, which points to the gl. This facilitates improvements for the next patch. Signed-off-by: Bob Peterson --- fs/gfs2/glock.c | 4 ++-- fs/gfs2/glops.c | 5 +++-- fs/gfs2

Re: [Cluster-devel] [PATCH v6 10/19] gfs2: Introduce flag for glock holder auto-demotion

2021-08-23 Thread Bob Peterson
k the glock as woundable before faulting, and then discover if it was wounded after faulting. Maybe sharing this terminology will aid in understanding? Hmm. Woundable. I like it. Andreas and I argued about the terminology but we never found a middle-ground. Perhaps this is it. Thanks, Matthew. Regards, Bob Peterson

Re: [Cluster-devel] [PATCH v6 10/19] gfs2: Introduce flag for glock holder auto-demotion

2021-08-20 Thread Bob Peterson
On 8/20/21 4:35 AM, Steven Whitehouse wrote: Hi, On Thu, 2021-08-19 at 21:40 +0200, Andreas Gruenbacher wrote: From: Bob Peterson This patch introduces a new HIF_MAY_DEMOTE flag and infrastructure that will allow glocks to be demoted automatically on locking conflicts. When a locking request

[Cluster-devel] [PATCH] gfs2: Remove redundant check from gfs2_glock_dq

2021-08-02 Thread Bob Peterson
dundancy. Signed-off-by: Bob Peterson --- fs/gfs2/glock.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index f0b846ba5cc8..1d421998535e 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -1484,12 +1484,11 @@ void gfs

  1   2   3   4   5   6   7   8   9   10   >