Re: [Cluster-devel] [syzbot] [gfs2?] WARNING: suspicious RCU usage in gfs2_permission

2023-10-30 Thread Andreas Gruenbacher
Al, On Wed, Oct 25, 2023 at 5:29 AM Al Viro wrote: > On Fri, Oct 20, 2023 at 12:10:38AM -0700, syzbot wrote: > > syzbot has bisected this issue to: > > > > commit 0abd1557e21c617bd13fc18f7725fc6363c05913 > > Author: Al Viro > > Date: Mon Oct 2 02:33:44 2023 + > > > > gfs2: fix an oops

[Cluster-devel] [GIT PULL] gfs2 fixes

2023-09-05 Thread Andreas Gruenbacher
quota fixes and cleanups by Bob. - Update the the mailing list address for gfs2 and dlm. (It's the same list for both and we are moving it to g...@lists.linux.dev.) - Various other minor cleanups. Andreas Gruenbacher (24

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

2023-08-24 Thread Andreas Gruenbacher
I've pushed the fixes for this bug to for-next. https://lore.kernel.org/cluster-devel/20230824211948.3242607-1-agrue...@redhat.com/ Thanks, Andreas

[Cluster-devel] [PATCH 1/9] gfs2: Use qd_sbd more consequently

2023-08-24 Thread Andreas Gruenbacher
a level of indirection. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher --- fs/gfs2/quota.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 96d41ee034d7..48b9fbffe260 100644 --- a/fs/gfs2/quota.c +++ b

[Cluster-devel] [PATCH 9/9] gfs2: Fix quota data refcount after cleanup

2023-08-24 Thread Andreas Gruenbacher
/2b5e2405f14e8...@google.com Reported-by: syzbot+3f6a670108ce43356...@syzkaller.appspotmail.com Signed-off-by: Andreas Gruenbacher --- fs/gfs2/ops_fstype.c | 1 + fs/gfs2/quota.c | 41 ++--- fs/gfs2/quota.h | 1 + fs/gfs2/super.c | 1 + 4 files changed

[Cluster-devel] [PATCH 7/9] gfs2: No more quota complaints after withdraw

2023-08-24 Thread Andreas Gruenbacher
Once a filesystem is withdrawn, don't complain about quota changes that can't be synced to the main quota file anymore. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/quota.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index

[Cluster-devel] [PATCH 3/9] gfs2: Rename SDF_DEACTIVATING to SDF_KILL

2023-08-24 Thread Andreas Gruenbacher
Rename the SDF_DEACTIVATING flag to SDF_KILL to make it more obvious that this relates to the kill_sb filesystem operation. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/glock.c | 4 ++-- fs/gfs2/glops.c | 2 +- fs/gfs2/incore.h | 2 +- fs/gfs2/ops_fstype.c | 4 ++-- fs/gfs2

[Cluster-devel] [PATCH 4/9] gfs2: Fix wrong quota shrinker return value

2023-08-24 Thread Andreas Gruenbacher
Function gfs2_qd_isolate must only return LRU_REMOVED when removing the item from the lru list; otherwise, the number of items on the list will go wrong. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/quota.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/gfs2

[Cluster-devel] [PATCH 8/9] gfs2: Fix initial quota data refcount

2023-08-24 Thread Andreas Gruenbacher
Fix the refcount of quota data objects created directly by gfs2_quota_init(): those are placed into the in-memory quota "database" for eventual syncing to the main quota file, but they are not actively held and should thus have an initial refcount of 0. Signed-off-by: Andreas Gruenbache

[Cluster-devel] [PATCH 2/9] gfs2: Rename sd_{ glock => kill }_wait

2023-08-24 Thread Andreas Gruenbacher
Rename sd_glock_wait to sd_kill_wait: we'll use it for other things related to "killing" a filesystem on unmount soon (kill_sb). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/glock.c | 6 +++--- fs/gfs2/incore.h | 2 +- fs/gfs2/ops_fstype.c | 2 +- 3 files changed, 5 insert

[Cluster-devel] [PATCH 5/9] gfs2: Use gfs2_qd_dispose in gfs2_quota_cleanup

2023-08-24 Thread Andreas Gruenbacher
in combination with a fix that follows. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/quota.c | 26 -- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index f58072efafc9..976bf1097706 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2

[Cluster-devel] [PATCH 6/9] gfs2: Factor out duplicate quota data disposal code

2023-08-24 Thread Andreas Gruenbacher
Rename gfs2_qd_dispose() to gfs2_qd_dispose_list(). Move some code duplicated in gfs2_qd_dispose_list() and gfs2_quota_cleanup() into a new gfs2_qd_dispose() function. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/quota.c | 47 --- 1 file changed

[Cluster-devel] [PATCH 0/9] gfs2: quota cleanups and fixes

2023-08-24 Thread Andreas Gruenbacher
://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git/log/?h=for-next Thanks, Andreas Andreas Gruenbacher (8): gfs2: Rename sd_{ glock => kill }_wait gfs2: Rename SDF_DEACTIVATING to SDF_KILL gfs2: Fix wrong quota shrinker return value gfs2: Use gfs2_qd_disp

[Cluster-devel] [PATCH 1/4] gfs2: Switch to wait_event in gfs2_logd

2023-08-24 Thread Andreas Gruenbacher
In gfs2_logd(), switch from an open-coded wait loop to wait_event_interruptible_timeout(). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index aa568796207c..d3da259820e3

[Cluster-devel] [PATCH 3/4] gfs2: Fix logd wakeup on I/O error

2023-08-24 Thread Andreas Gruenbacher
When quotad detects an I/O error, it sets sd_log_error and then it wakes up logd to withdraw the filesystem. However, logd doesn't wake up when sd_log_error is set. Fix that. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/gfs2/log.c

[Cluster-devel] [PATCH 4/4] gfs2: journal flush threshold fixes and cleanup

2023-08-24 Thread Andreas Gruenbacher
flush_reqd() and gfs2_ail_flush_reqd() can be used in gfs2_log_commit(). Make those two helpers available to gfs2_log_commit() by defining them above gfs2_log_commit(). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 34 -- 1 file changed, 16 insertions(+), 18 deletion

[Cluster-devel] [PATCH 0/4] gfs2: logd cleanups on for-next

2023-08-24 Thread Andreas Gruenbacher
The following four patches related to gfs2's logd daemon are currently queued up on our for-next branch, to be submitted upstream in the upcoming merge window. https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git/log/?h=for-next Thanks, Andreas Andreas Gruenbacher (4): gfs2

[Cluster-devel] [PATCH 2/4] gfs2: low-memory forced flush fixes

2023-08-24 Thread Andreas Gruenbacher
the SDF_FORCE_AIL_FLUSH flag check out of gfs2_ail_flush_reqd. In addition, in gfs2_writepages, logd needs to be woken up after setting the SDF_FORCE_AIL_FLUSH flag. Fixes: b066a4eebd4f ("gfs2: forcibly flush ail to relieve memory pressure") Signed-off-by: Andreas Gruenbacher --- fs/gfs2/aops.c | 4 +++

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

2023-08-23 Thread Andreas Gruenbacher
On Tue, Aug 22, 2023 at 9:32 PM Bob Peterson wrote: > On 1/26/23 11:10 PM, eada...@sina.com wrote: > > From: Edward Adam Davis > > > > [ 81.372851][ T5532] CPU: 1 PID: 5532 Comm: syz-executor.0 Not tainted > > 6.2.0-rc1-syzkaller-dirty #0 > > [ 81.382080][ T5532] Hardware name: Google

[Cluster-devel] [PATCH 2/3] gfs2: Remove LM_FLAG_PRIORITY flag

2023-08-09 Thread Andreas Gruenbacher
The last user of this flag was removed in commit b77b4a4815a9 ("gfs2: Rework freeze / thaw logic"). Signed-off-by: Andreas Gruenbacher --- Documentation/filesystems/gfs2-glocks.rst | 3 +-- fs/gfs2/glock.c | 22 ++ fs/gf

[Cluster-devel] [PATCH 1/3] gfs2: do_promote cleanup

2023-08-09 Thread Andreas Gruenbacher
Change function do_promote to return true on success, and false otherwise. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/glock.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 1438e7465e30..d0c82b721f90 100644 --- a/fs

[Cluster-devel] [PATCH 3/3] gfs2: conversion deadlock do_promote bypass

2023-08-09 Thread Andreas Gruenbacher
From: Bob Peterson Consider the following case: 1. A glock is held in shared mode. 2. A process requests the glock in exclusive mode (rename). 3. Before the lock is granted, more processes (read / ls) request the glock in shared mode again. 4. gfs2 sends a request to dlm for the lock in

Re: [Cluster-devel] [PATCH] gfs2: conversion deadlock do_promote bypass

2023-08-09 Thread Andreas Gruenbacher
Hi Bob, On Wed, Jul 26, 2023 at 8:36 PM Bob Peterson wrote: > I know the description is vague or hard to grasp, but it's hard to be > succinct for this problem. as discussed off-list, this one needed a bit more work. I've just posted the updated version. Thanks, Andreas

[Cluster-devel] [GIT PULL] gfs2 fixes

2023-08-08 Thread Andreas Gruenbacher
) gfs2 fixes - Fix a freeze consistency check in gfs2_trans_add_meta(). - Don't use filemap_splice_read as it can cause deadlocks on gfs2. Andreas Gruenbacher (1): gfs2: Fix freeze consistency

[Cluster-devel] [PATCH] gfs2: Don't use filemap_splice_read

2023-08-04 Thread Andreas Gruenbacher
ble, but it still wouldn't prevent cluster-wide deadlocks.) Fixes: 2cb1e08985e3 ("splice: Use filemap_splice_read() instead of generic_file_splice_read()") Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher --- fs/gfs2/file.c | 4 ++-- 1 file changed, 2 insertions(+)

[Cluster-devel] [PATCH] gfs2: Fix freeze consistency check in gfs2_trans_add_meta

2023-08-04 Thread Andreas Gruenbacher
not to call gfs2_assert_withdraw() with the sd_log_lock spin lock held. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/trans.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c index ec1631257978..6a58880668f7 100644 --- a/fs/gfs2/trans.c +++ b

Re: [Cluster-devel] [bug report] gfs2: Use mapping->gfp_mask for metadata inodes

2023-08-02 Thread Andreas Gruenbacher
On Wed, Aug 2, 2023 at 9:35 AM Dan Carpenter wrote: > Hello Andreas Gruenbacher, > > The patch 8f18190e3173: "gfs2: Use mapping->gfp_mask for metadata > inodes" from Jul 26, 2023 (linux-next), leads to the following Smatch > static checker warning: >

[Cluster-devel] [PATCH 2/2] gfs: Don't use GFP_NOFS in gfs2_unstuff_dinode

2023-07-31 Thread Andreas Gruenbacher
inode->i_mapping->gfp_mask set to GFP_NOFS (see the previous patch). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/bmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 8d611fbcf0bd..c2f0ed76a2b6 100644 --- a/fs/gfs2/bmap.c +++ b/fs

[Cluster-devel] [PATCH 1/2] gfs2: Use mapping->gfp_mask for metadata inodes

2023-07-31 Thread Andreas Gruenbacher
uot;GFS2: Change truncate page allocation to be GFP_NOFS"). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/inode.c | 10 -- fs/gfs2/lops.c | 7 +++ fs/gfs2/quota.c | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index

Re: [Cluster-devel] [PATCHv4 v6.5-rc2 3/3] fs: dlm: fix F_CANCELLK to cancel pending request

2023-07-24 Thread Andreas Gruenbacher
On Fri, Jul 21, 2023 at 8:55 PM Alexander Aring wrote: > Hi, > > On Fri, Jul 21, 2023 at 12:25 PM Andreas Gruenbacher > wrote: > > > > On Thu, Jul 20, 2023 at 2:22 PM Alexander Aring wrote: > > > This patch fixes the current handling of F_CANCELLK by not jus

Re: [Cluster-devel] [PATCHv4 v6.5-rc2 3/3] fs: dlm: fix F_CANCELLK to cancel pending request

2023-07-21 Thread Andreas Gruenbacher
On Thu, Jul 20, 2023 at 2:22 PM Alexander Aring wrote: > This patch fixes the current handling of F_CANCELLK by not just doing a > unlock as we need to try to cancel a lock at first. A unlock makes sense > on a non-blocking lock request but if it's a blocking lock request we > need to cancel the

Re: [Cluster-devel] [PATCH v1] gfs2: increase usage of folio_next_index() helper

2023-07-17 Thread Andreas Gruenbacher
Minjie, On Mon, Jul 17, 2023 at 9:20 AM Minjie Du wrote: > Simplify code pattern of 'folio->index + folio_nr_pages(folio)' by using > the existing helper folio_next_index(). > > Signed-off-by: Minjie Du > --- > fs/gfs2/aops.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff

Re: [Cluster-devel] [PATCH v6.5-rc1 1/2] fs: dlm: introduce DLM_PLOCK_FL_NO_REPLY flag

2023-07-14 Thread Andreas Gruenbacher
On Thu, Jul 13, 2023 at 4:40 PM Alexander Aring wrote: > This patch introduces a new flag DLM_PLOCK_FL_NO_REPLY in case an dlm > plock operation should not send a reply back. Currently this is kind of > being handled in DLM_PLOCK_FL_CLOSE, but DLM_PLOCK_FL_CLOSE has more > meanings that it will

Re: [Cluster-devel] [PATCH] gfs2: fix timestamp handling on quota inodes

2023-07-13 Thread Andreas Gruenbacher
inode->i_mtime = inode->i_atime = current_time(inode); > + inode->i_mtime = inode_set_ctime_current(inode); > mark_inode_dirty(inode); > set_bit(QDF_REFRESH, >qd_flags); > } > -- > 2.41.0 > Reviewed-by: Andreas Gruenbacher Thanks, Andreas

Re: [Cluster-devel] gfs2 write bandwidth regression on 6.4-rc3 compareto 5.15.y

2023-07-10 Thread Andreas Gruenbacher
Hi Wang Yugui, On Sun, May 28, 2023 at 5:53 PM Wang Yugui wrote: > Hi, > > > Hi, > > > > gfs2 write bandwidth regression on 6.4-rc3 compare to 5.15.y. > > > > we added linux-xfs@ and linux-fsdevel@ because some related problem[1] > > and related patches[2]. > > > > we compared 6.4-rc3(rather

Re: [Cluster-devel] [PATCH 7/9] gfs2: update ctime when quota is updated

2023-07-05 Thread Andreas Gruenbacher
On Mon, Jun 12, 2023 at 12:36 PM Jeff Layton wrote: > On Fri, 2023-06-09 at 18:44 +0200, Andreas Gruenbacher wrote: > > Jeff, > > > > On Fri, Jun 9, 2023 at 2:50 PM Jeff Layton wrote: > > > Signed-off-by: Jeff Layton > > > --- > > > fs/gfs2/q

[Cluster-devel] [GIT PULL] gfs2 fixes

2023-07-04 Thread Andreas Gruenbacher
-internal reads when they are interruped by a signal. - Eliminate kmap_atomic() in favor of kmap_local_page() / memcpy_{from,to}_page(). - Get rid of noop_direct_IO. - And a few more minor fixes and cleanups. Andreas Gruenbacher (12

Re: [Cluster-devel] [PATCH] fs: Fix bug in gfs2_freeze_func that can cause deadlock

2023-07-03 Thread Andreas Gruenbacher
Li Dong, On Tue, Jun 20, 2023 at 5:47 AM Li Dong wrote: > Function gfs2_freeze_func causes a deadlock,because sd_freeze_mutex was > not released when return > > Signed-off-by: Li Dong > --- > fs/gfs2/super.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git

Re: [Cluster-devel] [PATCH v3 0/6] gfs2: kmap{_atomic} conversion to kmap_local_{page/folio}

2023-07-03 Thread Andreas Gruenbacher
Hi Deepak, On Thu, Jun 29, 2023 at 11:48 PM Deepak R Varma wrote: > This patch series proposes to replace the kmap/kmap_atomic implementation to > the > preferred kmap_local_* APIs. > > The code blocks for this module where kmap/kmap_atomic calls are implemented > do > not appear to depend on

[Cluster-devel] [PATCH 2/2] gfs2: Use memcpy_{from, to}_page where appropriate

2023-06-27 Thread Andreas Gruenbacher
Replace kmap_local_page() + memcpy() + kunmap_local() sequences with memcpy_{from,to}_page() where we are not doing anything else with the mapped page. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/aops.c | 5 + fs/gfs2/lops.c | 12 +--- fs/gfs2/quota.c | 5 + 3 files

[Cluster-devel] [PATCH 1/2] gfs2: Convert remaining kmap_atomic calls to kmap_local_page

2023-06-27 Thread Andreas Gruenbacher
Replace the remaining instances of kmap_atomic() ... kunmap_atomic() with kmap_local_page() ... kunmap_local(). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/lops.c | 13 +++-- fs/gfs2/quota.c | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/fs/gfs2/lops.c b

Re: [Cluster-devel] [PATCH v2] gfs2: Replace deprecated kmap_atomic() by kmap_local_page()

2023-06-27 Thread Andreas Gruenbacher
On Mon, Jun 26, 2023 at 8:51 AM Deepak R Varma wrote: > kmap_atomic() is deprecated in favor of kmap_local_{folio,page}(). I'll apply this, convert the remaining instances of kmap_atomic(), and switch to memcpy_{from,to}_page() where appropriate. Thanks, Andreas > Therefore, replace

[Cluster-devel] [PATCH] gfs: Get rid of unnucessary locking in inode_go_dump

2023-06-27 Thread Andreas Gruenbacher
Commit 27a2660f1ef9 ("gfs2: Dump nrpages for inodes and their glocks") added some locking around reading inode->i_data.nrpages. That locking doesn't do anything really, so get rid of it. With that, the glock argument to ->go_dump() can be made const again as well. Signed

[Cluster-devel] [PATCH] gfs2: retry interrupted internal reads

2023-06-13 Thread Andreas Gruenbacher
The iomap-based read operations done by gfs2 for its system files, such as rindex, may sometimes be interrupted and return -EINTR. This confuses some users of gfs2_internal_read(). Fix that by retrying interrupted reads. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher --- fs

Re: [Cluster-devel] [PATCH 6/8] gfs2: Rework freeze / thaw logic

2023-06-13 Thread Andreas Gruenbacher
On Tue, Jun 13, 2023 at 3:05 PM Alexander Aring wrote: > Hi Andreas, > > On Mon, Jun 12, 2023 at 12:33 PM Andreas Gruenbacher > wrote: > ... > > > > @@ -152,24 +151,18 @@ static void signal_our_withdraw(struct gfs2_sbd *sdp) > > */ > >

Re: [Cluster-devel] [PATCH 6/8] gfs2: Rework freeze / thaw logic

2023-06-13 Thread Andreas Gruenbacher
On Tue, Jun 13, 2023 at 12:29 PM Andrew Price wrote: > On 12/06/2023 17:33, Andreas Gruenbacher wrote: > > So far, at mount time, gfs2 would take the freeze glock in shared mode > > and then immediately drop it again, turning it into a cached glock that > > can be

Re: [Cluster-devel] [PATCH] gfs2: Fix possible data races in gfs2_show_options()

2023-06-13 Thread Andreas Gruenbacher
On Tue, Jun 13, 2023 at 5:07 AM Tuo Li wrote: > Some fields such as gt_logd_secs of the struct gfs2_tune are accessed > without holding the lock gt_spin in gfs2_show_options(): > > val = sdp->sd_tune.gt_logd_secs; > if (val != 30) > seq_printf(s, ",commit=%d", val); > > And thus can cause

Re: [Cluster-devel] [PATCH v3 00/14] gfs2/buffer folio changes for 6.5

2023-06-12 Thread Andreas Gruenbacher
he big point of this series is that block_write_full_page() should now > handle large folios correctly. This is great, thank you. For the gfs2 bits: Reviewed-by: Andreas Gruenbacher > Andrew, if you want, I'll drop it into the pagecache tree, or you > can just take it. > > v3: >

[Cluster-devel] [PATCH] gfs2: Fix duplicate should_fault_in_pages() call

2023-06-12 Thread Andreas Gruenbacher
the more efficient multi-page writes first. Fix that by moving the retry label to the correct place, behind the first call to should_fault_in_pages(). Fixes: e1fa9ea85ce8 ("gfs2: Stop using glock holder auto-demotion for now") Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher --

[Cluster-devel] [PATCH 8/8] gfs2: gfs2_freeze_lock_shared cleanup

2023-06-12 Thread Andreas Gruenbacher
All the remaining users of gfs2_freeze_lock_shared() set freeze_gh to >sd_freeze_gh and flags to 0, so remove those two parameters. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/ops_fstype.c | 2 +- fs/gfs2/super.c | 4 ++-- fs/gfs2/util.c | 9 +++-- fs/gfs2/util.h

[Cluster-devel] [PATCH 6/8] gfs2: Rework freeze / thaw logic

2023-06-12 Thread Andreas Gruenbacher
int of view, taking and immediately dropping a glock is indistinguishable from taking the glock and only dropping it upon contention, so this new scheme is compatible with the old one. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/glops.c | 52 + fs/gfs2/log.c| 2 -

[Cluster-devel] [PATCH 7/8] gfs2: Replace sd_freeze_state with SDF_FROZEN flag

2023-06-12 Thread Andreas Gruenbacher
Replace sd_freeze_state with a new SDF_FROZEN flag. There no longer is a need for indicating that a freeze is in progress (SDF_STARTING_FREEZE); we are now protecting the critical sections with the sd_freeze_mutex. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/incore.h | 8 +--- fs

[Cluster-devel] [PATCH 5/8] gfs2: Rename SDF_{FS_FROZEN => FREEZE_INITIATOR}

2023-06-12 Thread Andreas Gruenbacher
Rename the SDF_FS_FROZEN flag to SDF_FREEZE_INITIATOR to indicate more clearly that the node that has this flag set is the initiator of the freeze. Signed-off-by: Andreas Gruenbacher sd_flags); - wake_up_bit(>sd_flags, SDF_FS_FROZEN); + clear_bit_unlock(SDF_FREEZE_INITIATOR, >sd

[Cluster-devel] [PATCH 4/8] gfs2: Reconfiguring frozen filesystem already rejected

2023-06-12 Thread Andreas Gruenbacher
Reconfiguring a frozen filesystem is already rejected in reconfigure_super(), so there is no need to check for that condition again at the filesystem level. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/ops_fstype.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/fs/gfs2/ops_fstype.c

[Cluster-devel] [PATCH 3/8] gfs2: Rename gfs2_freeze_lock{ => _shared }

2023-06-12 Thread Andreas Gruenbacher
Rename gfs2_freeze_lock to gfs2_freeze_lock_shared to make it a bit more obvious that this function establishes the "thawed" state of the freeze glock. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/ops_fstype.c | 4 ++-- fs/gfs2/recovery.c | 2 +- fs/gfs2/super.c | 2 +

[Cluster-devel] [PATCH 2/8] gfs2: Rename the {freeze, thaw}_super callbacks

2023-06-12 Thread Andreas Gruenbacher
Rename gfs2_freeze to gfs2_freeze_super and gfs2_unfreeze to gfs2_thaw_super to match the names of the corresponding super operations. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/super.c | 12 ++-- fs/gfs2/util.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git

[Cluster-devel] [PATCH 1/8] gfs2: Rename remaining "transaction" glock references

2023-06-12 Thread Andreas Gruenbacher
The transaction glock was repurposed to serve as the new freeze glock years ago. Don't refer to it as the transaction glock anymore. Also, to be more precise, call it the "freeze glock" instead of the "freeze lock". Ditto for the journal glock. Signed-off-by: Andreas Gruen

[Cluster-devel] [PATCH 0/8] gfs2: Rework freeze / thaw logic

2023-06-12 Thread Andreas Gruenbacher
engine. Andreas Gruenbacher (8): gfs2: Rename remaining "transaction" glock references gfs2: Rename the {freeze,thaw}_super callbacks gfs2: Rename gfs2_freeze_lock{ => _shared } gfs2: Reconfiguring frozen filesystem already rejected gfs2: Rename SDF_{FS_FROZEN => FREEZE_I

Re: [Cluster-devel] [PATCH] gfs2: set FMODE_CAN_ODIRECT instead of a dummy direct_IO method

2023-06-12 Thread Andreas Gruenbacher
On Mon, Jun 12, 2023 at 7:54 AM Christoph Hellwig wrote: > Since commit a2ad63daa88b ("VFS: add FMODE_CAN_ODIRECT file flag") file > systems can just set the FMODE_CAN_ODIRECT flag at open time instead of > wiring up a dummy direct_IO method to indicate support for direct I/O. > > Remove

Re: [Cluster-devel] [PATCH 7/9] gfs2: update ctime when quota is updated

2023-06-09 Thread Andreas Gruenbacher
Jeff, On Fri, Jun 9, 2023 at 2:50 PM Jeff Layton wrote: > Signed-off-by: Jeff Layton > --- > fs/gfs2/quota.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c > index 1ed17226d9ed..6d283e071b90 100644 > --- a/fs/gfs2/quota.c > +++

Re: [Cluster-devel] [GIT PULL] gfs2 fix

2023-06-06 Thread Andreas Gruenbacher
On Tue, Jun 6, 2023 at 2:55 PM Linus Torvalds wrote: > On Tue, Jun 6, 2023 at 5:48 AM Andreas Gruenbacher > wrote: > > > > - Don't get stuck writing page onto itself under direct I/O. > > Btw, is there a test for this DIO case? The previous test case I wrote for th

[Cluster-devel] [GIT PULL] gfs2 fix

2023-06-06 Thread Andreas Gruenbacher
) gfs2 fix - Don't get stuck writing page onto itself under direct I/O. Andreas Gruenbacher (1): gfs2: Don't get stuck writing page onto itself under direct I/O fs/gfs2/file.c | 17

Re: [Cluster-devel] [PATCH 3/6] gfs2: Convert gfs2_write_jdata_page() to gfs2_write_jdata_folio()

2023-06-04 Thread Andreas Gruenbacher
On Sun, Jun 4, 2023 at 5:38 AM Matthew Wilcox wrote: > > On Sat, Jun 03, 2023 at 11:34:14AM +0200, Andreas Gruenbacher wrote: > > > * This is the same as calling block_write_full_page, but it also > > > * writes pages outside of i_size > > > */ > > >

Re: [Cluster-devel] [PATCHv2 dlm/next] fs: dlm: avoid F_SETLKW plock op lookup collisions

2023-06-03 Thread Andreas Gruenbacher
On Thu, Jun 1, 2023 at 9:10 PM Alexander Aring wrote: > Hi, > > On Thu, Jun 1, 2023 at 1:11 PM Andreas Gruenbacher > wrote: > > > > On Thu, Jun 1, 2023 at 6:28 PM Alexander Aring wrote: > > > Hi, > > > > > > On Tue, May 30

Re: [Cluster-devel] [PATCH 5/6] gfs2: Support ludicrously large folios in gfs2_trans_add_databufs()

2023-06-03 Thread Andreas Gruenbacher
On Tue, May 23, 2023 at 3:37 PM Matthew Wilcox wrote: > On Tue, May 23, 2023 at 02:46:07PM +0200, Andreas Gruenbacher wrote: > > > void gfs2_trans_add_databufs(struct gfs2_inode *ip, struct folio *folio, > > > -unsigned int f

Re: [Cluster-devel] [PATCH 3/6] gfs2: Convert gfs2_write_jdata_page() to gfs2_write_jdata_folio()

2023-06-03 Thread Andreas Gruenbacher
Hi Willy, thanks for these patches. This particular one looks problematic: On Wed, May 17, 2023 at 5:24 AM Matthew Wilcox (Oracle) wrote: > This function now supports large folios, even if nothing around it does. > > Signed-off-by: Matthew Wilcox (Oracle) > --- > fs/gfs2/aops.c | 27

Re: [Cluster-devel] [PATCHv2 dlm/next] fs: dlm: avoid F_SETLKW plock op lookup collisions

2023-06-01 Thread Andreas Gruenbacher
On Thu, Jun 1, 2023 at 6:28 PM Alexander Aring wrote: > Hi, > > On Tue, May 30, 2023 at 1:40 PM Andreas Gruenbacher > wrote: > > > > On Tue, May 30, 2023 at 4:08 PM Alexander Aring wrote: > > > Hi, > > > > > > On Tue, May 30

Re: [Cluster-devel] [PATCHv2 dlm/next] fs: dlm: avoid F_SETLKW plock op lookup collisions

2023-05-30 Thread Andreas Gruenbacher
On Tue, May 30, 2023 at 4:08 PM Alexander Aring wrote: > Hi, > > On Tue, May 30, 2023 at 7:01 AM Andreas Gruenbacher > wrote: > > > > On Tue, May 30, 2023 at 12:19 AM Alexander Aring > > wrote: > > > Hi, > > > > > > On Thu,

Re: [Cluster-devel] [PATCHv2 dlm/next] fs: dlm: avoid F_SETLKW plock op lookup collisions

2023-05-30 Thread Andreas Gruenbacher
On Tue, May 30, 2023 at 12:19 AM Alexander Aring wrote: > Hi, > > On Thu, May 25, 2023 at 11:02 AM Andreas Gruenbacher > wrote: > > > > On Wed, May 24, 2023 at 6:02 PM Alexander Aring wrote: > > > This patch fixes a possible plock op collisions when using F_SE

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

2023-05-25 Thread Andreas Gruenbacher
On Wed, May 24, 2023 at 8:54 AM Christoph Hellwig wrote: > All callers of iomap_file_buffered_write need to updated ki_pos, move it > into common code. Thanks for this set of cleanups, especially for the patch killing current->backing_dev_info. Reviewed-by: Andreas Gruenbacher >

Re: [Cluster-devel] [PATCHv2 dlm/next] fs: dlm: avoid F_SETLKW plock op lookup collisions

2023-05-25 Thread Andreas Gruenbacher
On Wed, May 24, 2023 at 6:02 PM 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 not enough

Re: [Cluster-devel] [PATCH 5/6] gfs2: Support ludicrously large folios in gfs2_trans_add_databufs()

2023-05-23 Thread Andreas Gruenbacher
On Wed, May 17, 2023 at 5:24 AM Matthew Wilcox (Oracle) wrote: > We may someday support folios larger than 4GB, so use a size_t for > the byte count within a folio to prevent unpleasant truncations. > > Signed-off-by: Matthew Wilcox (Oracle) > --- > fs/gfs2/aops.c | 2 +- > fs/gfs2/aops.h | 2

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

2023-05-10 Thread Andreas Gruenbacher
Hello Linus, could you please pull the following gfs2 fix for 6.4? Thanks, Andreas The following changes since commit e0fcc9c68d1147ca33159d57332b02ca8bac6ab9: Merge tag 'gfs2-v6.3-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 (2023-04-26 09:28:15 -0700) are

[Cluster-devel] [PATCH] dlm_controld: remove old build workaround

2023-05-03 Thread Andreas Gruenbacher
Remove the old build workaround from 2011, when DLM_PLOCK_FL_CLOSE wasn't always defined in . Signed-off-by: Andreas Gruenbacher --- dlm_controld/plock.c | 20 +--- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/dlm_controld/plock.c b/dlm_controld/plock.c index

[Cluster-devel] [GIT PULL] gfs2 fixes for 6.4

2023-04-25 Thread Andreas Gruenbacher
) gfs2 fixes - Fix revoke processing at unmount and on read-only remount. - Refuse reading in inodes with an impossible indirect block height. - Various minor cleanups. Andreas Gruenbacher

Re: [Cluster-devel] [PATCH 05/17] filemap: update ki_pos in generic_perform_write

2023-04-24 Thread Andreas Gruenbacher
On Mon, Apr 24, 2023 at 8:22 AM Christoph Hellwig wrote: > All callers of generic_perform_write need to updated ki_pos, move it into > common code. We've actually got a similar situation with iomap_file_buffered_write() and its callers. Would it make sense to fix that up as well? >

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

2023-04-24 Thread Andreas Gruenbacher
On Fri, Apr 21, 2023 at 9:07 PM Bob Peterson wrote: > Before this patch function gfs2_make_fs_ro called gfs2_log_flush once to > finalize the log. However, if there's dirty metadata, log flushes tend > to sync the metadata and formulate revokes. Before this patch, those > revokes may not be

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

2023-04-24 Thread Andreas Gruenbacher
On Fri, Apr 21, 2023 at 9:07 PM Bob Peterson wrote: > Before this patch, function gfs2_ail_empty_gl did not return errors it > encountered from __gfs2_trans_begin. Those errors usually came from the > fact that the file system was made read-only, often due to unmount, > (but theoretically could

Re: [Cluster-devel] [PATCH v3 11/19] gfs: use __bio_add_page for adding single page to bio

2023-04-19 Thread Andreas Gruenbacher
GFS, but otherwise this is obviously fine, thanks. > Use __bio_add_page() as adding a single page to a newly created bio is > guaranteed to succeed. > > This brings us a step closer to marking bio_add_page() as __must_check. > > Signed-off-by: Johannes Thumshirn > Reviewed-by: Damien Le

Re: [Cluster-devel] [PATCH] gfs2: Move a variable assignment behind a null pointer check in inode_go_dump()

2023-04-18 Thread Andreas Gruenbacher
Hi Markus, On Thu, Apr 13, 2023 at 9:23 PM Markus Elfring wrote: > Date: Thu, 13 Apr 2023 20:54:30 +0200 > > The address of a data structure member was determined before > a corresponding null pointer check in the implementation of > the function “inode_go_dump”. > > Thus avoid the risk for

Re: [Cluster-devel] [PATCH] gfs2 FS: Fix UBSAN array-index-out-of-bounds in __gfs2_iomap_get

2023-03-27 Thread Andreas Gruenbacher
Hello Ivan, On Wed, Mar 15, 2023 at 10:06 AM Ivan Orlov wrote: > Syzkaller reported the following issue: > > UBSAN: array-index-out-of-bounds in fs/gfs2/bmap.c:901:46 > index 11 is out of range for type 'u64 [11]' > CPU: 0 PID: 5067 Comm: syz-executor164 Not tainted >

[Cluster-devel] [PATCH] gfs2: Fix inode height consistency check

2023-03-27 Thread Andreas Gruenbacher
filesystem block size; they will often be slightly bigger than what's needed for a specific filesystem. Reported-by: syzbot+45d4691b1ed3c48eb...@syzkaller.appspotmail.com Signed-off-by: Andreas Gruenbacher --- fs/gfs2/glops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs

Re: [Cluster-devel] [PATCH 0/3] gfs2_(un)link cleanups

2023-03-27 Thread Andreas Gruenbacher
On Tue, Mar 14, 2023 at 2:18 PM Andrew Price wrote: > Some trivial cleanups from my O_TMPFILE branch. That work isn't ready > yet but there was no reason not to send these patches. Applied, thanks. Andreas

[Cluster-devel] Andy gfs2 patches?

2023-03-23 Thread Andreas Gruenbacher

[Cluster-devel] [GIT PULL] gfs2 fix for v6.3-rc4

2023-03-23 Thread Andreas Gruenbacher
From: Linus Torvalds Hi Linus, please consider pulling the following fix. Thanks, Andreas The following changes since commit e8d018dd0257f744ca50a729e3d042cf2ec9da65: Linux 6.3-rc3 (2023-03-19 13:27:55 -0700) are available in the Git repository at:

Re: [Cluster-devel] [PATCH] dlm_controld: set posix_lock flags to zero

2023-03-21 Thread Andreas Gruenbacher
On Tue, Mar 21, 2023 at 2:17 PM Alexander Aring wrote: > This patch sets another flags variable to zero which is a leftover of > commit 0834ed4b ("dlm_controld: initialize waiter->flags"). > --- > dlm_controld/plock.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/dlm_controld/plock.c

Re: [Cluster-devel] [PATCH 1/4] fs: add i_blocksize_mask()

2023-03-09 Thread Andreas Gruenbacher
On Thu, Mar 9, 2023 at 10:43 AM Yangtao Li wrote: > Introduce i_blocksize_mask() to simplify code, which replace > (i_blocksize(node) - 1). Like done in commit > 93407472a21b("fs: add i_blocksize()"). I would call this i_blockmask(). Note that it could be used in ocfs2_is_io_unaligned() as

Re: [Cluster-devel] return an ERR_PTR from __filemap_get_folio v3

2023-03-07 Thread Andreas Gruenbacher
On Tue, Mar 7, 2023 at 4:07 PM Christoph Hellwig wrote: > __filemap_get_folio and its wrappers can return NULL for three different > conditions, which in some cases requires the caller to reverse engineer > the decision making. This is fixed by returning an ERR_PTR instead of > NULL and thus

Re: [Cluster-devel] [PATCH dlm-tool 13/14] dlm_controld: plock log lock state

2023-03-03 Thread Andreas Gruenbacher
On Fri, Mar 3, 2023 at 4:53 PM Andreas Gruenbacher wrote: > diff --git a/dlm_controld/plock.c b/dlm_controld/plock.c > index 39bdd1f6..588bcaaa 100644 > --- a/dlm_controld/plock.c > +++ b/dlm_controld/plock.c > @@ -8,6 +8,7 @@ > > #include "dlm_daemon.h" > #i

Re: [Cluster-devel] [PATCH dlm-tool 13/14] dlm_controld: plock log lock state

2023-03-03 Thread Andreas Gruenbacher
Now, let me get to the core of the matter. We've been talking about using user-space (SDT) trace points for collecting the data, and I still think that that's what we should do instead of introducing a new dlm_controld log file. In the dlm_controld code, this would look like the below patch.

Re: [Cluster-devel] [PATCH dlm-tool 13/14] dlm_controld: plock log lock state

2023-03-03 Thread Andreas Gruenbacher
Alexx, can you please prefix this patch with the following to make this easier to read? Thanks, Andreas -- dlm_controld: pass lockspace and lock number to add_lock() The next patch will make use of the additional arguments. --- dlm_controld/plock.c | 41

[Cluster-devel] [GIT PULL] gfs2 fixes

2023-02-22 Thread Andreas Gruenbacher
des. At unmount time, evict deleted inodes cooperatively across the cluster to avoid unnecessary timeouts. - Various minor cleanups and fixes. ---- Andreas Gruenbacher (12): gfs2: gl_object races fix gfs2: Impr

[Cluster-devel] [PATCH] gfs2: Improve gfs2_make_fs_rw error handling

2023-01-31 Thread Andreas Gruenbacher
the gfs2_withdrawn() check after gfs2_find_jhead(). Reported-by: Tetsuo Handa Cc: syzbot+f51cb4b9afbd87ec0...@syzkaller.appspotmail.com Signed-off-by: Andreas Gruenbacher --- fs/gfs2/super.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c

Re: [Cluster-devel] [RFC v6 05/10] iomap/gfs2: Get page in page_prepare handler

2023-01-31 Thread Andreas Gruenbacher
On Tue, Jan 31, 2023 at 8:37 PM Matthew Wilcox wrote: > On Sun, Jan 08, 2023 at 08:40:29PM +0100, Andreas Gruenbacher wrote: > > +static struct folio * > > +gfs2_iomap_page_prepare(struct iomap_iter *iter, loff_t pos, unsigned len) > > { > > + struct

Re: [Cluster-devel] [syzbot] INFO: task hung in freeze_super (3)

2023-01-31 Thread Andreas Gruenbacher
Hello, On Wed, Jan 4, 2023 at 3:37 PM Tetsuo Handa wrote: > syzbot is reporting hung task at freeze_super() after emitting > "gfs2: fsid=loop0.0: can't make FS RW: -5" message due to gfs2_find_jhead() > from gfs2_make_fs_rw() from gfs2_fill_super() failing with -EIO. > > When hung task message

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

2023-01-30 Thread Andreas Gruenbacher
Hello Edward, On Fri, Jan 27, 2023 at 6:12 AM wrote: > From: Edward Adam Davis > > [ 81.372851][ T5532] CPU: 1 PID: 5532 Comm: syz-executor.0 Not tainted > 6.2.0-rc1-syzkaller-dirty #0 > [ 81.382080][ T5532] Hardware name: Google Google Compute Engine/Google > Compute Engine, BIOS Google

[Cluster-devel] [GIT PULL] gfs2 writepage fix

2023-01-22 Thread Andreas Gruenbacher
6:14 +0100) gfs2 writepage fix - Fix a regression introduced by commit "gfs2: stop using generic_writepages in gfs2_ail1_start_one". -------- Andreas Gruenbacher (1): Revert "gfs2: stop using generic_writepag

Re: [Cluster-devel] [PATCH] Revert "gfs2: stop using generic_writepages in gfs2_ail1_start_one"

2023-01-22 Thread Andreas Gruenbacher
On Sat, Jan 21, 2023 at 3:29 PM Christoph Hellwig wrote: > > > + struct address_space *mapping = data; > > + int ret = mapping->a_ops->writepage(page, wbc); > > + mapping_set_error(mapping, ret); > > + return ret; > > I guess beggars can't be choosers, but is there a chance to

[Cluster-devel] [PATCH] Revert "gfs2: stop using generic_writepages in gfs2_ail1_start_one"

2023-01-20 Thread Andreas Gruenbacher
rt of the original generic_writepages(). This reverts commit b2b0a5e978552e348f85ad9c7568b630a5ede659. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 723639376ae2..61323deb80bc 100644 --- a/f

Re: [Cluster-devel] [PATCH 1/4] gfs2: stop using generic_writepages in gfs2_ail1_start_one

2023-01-18 Thread Andreas Gruenbacher
nt > for cgroup writeback. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Andreas Gruenbacher > --- > fs/gfs2/log.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c > index f0ee3ff6f9a87..a66e3b1f6d178 10064

  1   2   3   4   5   6   7   8   9   10   >