[Cluster-devel] [PATCH] gfs2: Prevent direct-I/O write fallback errors from getting lost

2021-05-11 Thread Andreas Gruenbacher
When a direct I/O write falls entirely and falls back to buffered I/O and the buffered I/O fails, the write failed with return value 0 instead of the error number reported by the buffered I/O. Fix that. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/file.c | 4 +++- 1 file changed, 3 insertions

Re: [Cluster-devel] Hole punch races in GFS2

2021-04-29 Thread Andreas Gruenbacher
On Thu, Apr 22, 2021 at 5:57 PM Bob Peterson wrote: > - Original Message - > > OK, thanks for explanation! I missed that GFS2 glocks are task local. But > > then I have another question. We have the following: > > > > gfs2_file_read_iter() > > grabs inode glock in shared mode > > gener

Re: [Cluster-devel] [PATCH 1/3] fs/buffer.c: add new api to allow eof writeback

2021-04-29 Thread Andreas Gruenbacher
Junxiao, On Tue, Apr 27, 2021 at 4:44 AM Junxiao Bi wrote: > When doing truncate/fallocate for some filesytem like ocfs2, it > will zero some pages that are out of inode size and then later > update the inode size, so it needs this api to writeback eof > pages. is this in reaction to Jan's "[PAT

[Cluster-devel] [GIT PULL] GFS2 changes for 5.13

2021-04-29 Thread Andreas Gruenbacher
nformation. -------- Andreas Gruenbacher (7): gfs2: Remove unused variable sb_format gfs2: Add new gfs2_iomap_get helper gfs2: Turn gfs2_extent_map into gfs2_{get,alloc}_extent gfs2: Replace gfs2_lblk_to_dblk with gfs2_get_extent gfs2: Turn gfs2_meta_indirect_buffer into gfs2_m

Re: [Cluster-devel] [PATCH 1/8] Import linux/gfs2_ondisk.h

2021-04-20 Thread Andreas Gruenbacher
On Tue, Apr 20, 2021 at 10:34 AM Andrew Price wrote: > On 20/04/2021 07:00, Andreas Gruenbacher wrote: > > On Mon, Apr 19, 2021 at 10:47 PM Andrew Price wrote: > >> On 19/04/2021 20:35, Andreas Gruenbacher wrote: > >>> Andy, > >>> > >>&g

Re: [Cluster-devel] [PATCH 1/8] Import linux/gfs2_ondisk.h

2021-04-19 Thread Andreas Gruenbacher
On Mon, Apr 19, 2021 at 10:47 PM Andrew Price wrote: > On 19/04/2021 20:35, Andreas Gruenbacher wrote: > > Andy, > > > > On Mon, Apr 19, 2021 at 9:11 PM Andrew Price wrote: > >> diff --git a/gfs2/include/gfs2_ondisk.h b/gfs2/include/gfs2_ondisk.h > >> n

Re: [Cluster-devel] [PATCH 1/8] Import linux/gfs2_ondisk.h

2021-04-19 Thread Andreas Gruenbacher
Andy, On Mon, Apr 19, 2021 at 9:11 PM Andrew Price wrote: > diff --git a/gfs2/include/gfs2_ondisk.h b/gfs2/include/gfs2_ondisk.h > new file mode 100644 > index ..fc948f89 > --- /dev/null > +++ b/gfs2/include/gfs2_ondisk.h any reason why this file shouldn't be at gfs2/include/linux/gfs2_o

Re: [Cluster-devel] [PATCH v2 0/8] gfs2-utils: Import linux/gfs2_ondisk.h

2021-04-19 Thread Andreas Gruenbacher
Hi Andy, On Mon, Apr 19, 2021 at 9:11 PM Andrew Price wrote: > v1: https://listman.redhat.com/archives/cluster-devel/2019-April/msg00021.html > > My previous attempt at this did a search+replace to satisfy the field types > in gfs2_ondisk.h, which was a little OTT. This attempt adds a linux/type

Re: [Cluster-devel] [gfs2 PATCH] gfs2: allocate pages for clone bitmaps

2021-04-12 Thread Andreas Gruenbacher
On Sat, Apr 10, 2021 at 3:49 PM Bob Peterson wrote: > Resource group (rgrp) bitmaps have in-core-only "clone" bitmaps that > ensure freed fs space from deletes are not reused until the transaction > is complete. Before this patch, these clone bitmaps were allocated with > kmalloc, but with the def

Re: [Cluster-devel] [PATCH 00/18] Rid W=1 warnings from GFS2

2021-04-09 Thread Andreas Gruenbacher
Hi Lee, On Tue, Apr 6, 2021 at 1:54 PM Lee Jones wrote: > > > These have been on the list for a couple of weeks now. thanks for your fixes, I've gone through them now. I've fixed up some comments instead of "demoting" them to make the patch somewhat less destructive, and I found a few more minor

Re: [Cluster-devel] [PATCH] gfs2: Allocate bufdata object before taking log lock

2021-04-07 Thread Andreas Gruenbacher
On Tue, Apr 6, 2021 at 7:09 PM Andreas Gruenbacher wrote: > Before this patch, functions gfs2_trans_add_{meta,data} would take the > log lock, then if they needed to allocate a new bufdata object, they > would drop the lock and reacquire it. This patch changes it so that if > there&

[Cluster-devel] [PATCH] gfs2: Allocate bufdata object before taking log lock

2021-04-06 Thread Andreas Gruenbacher
l files on disk"), is actually still needed. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/trans.c | 46 +- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c index 63fec11ef2ce..c50de22d7cbf 100644 -

Re: [Cluster-devel] Unsubscribe from list

2021-04-06 Thread Andreas Gruenbacher
Hi, On Tue, Apr 6, 2021 at 4:11 PM Andreas Schindler wrote: > Please unsubscribe my email address or give me a link where i can do it on my > own.see the headers of any email from the list: see the headers of any mail delivered to you via the list: List-Unsubscribe:

Re: [Cluster-devel] [GFS2 PATCH v2] gfs2: fast dealloc for exhash directories

2021-04-06 Thread Andreas Gruenbacher
On Mon, Mar 22, 2021 at 3:15 PM Bob Peterson wrote: > Before this patch, whenever a directory was deleted, it called function > __gfs2_dir_exhash_dealloc to deallocate the directory's leaf blocks. > But __gfs2_dir_exhash_dealloc never knew if any given leaf block had > leaf continuation aka "next"

[Cluster-devel] [GIT PULL] gfs2 fixes for v5.12-rc6

2021-04-03 Thread Andreas Gruenbacher
Hi Linus, please consider pulling the following two gfs2 fixes for v5.12-rc6. Thanks, Andreas The following changes since commit b77b5fdd052e7ee61b35164abb10e8433d3160e8: Merge tag 'gfs2-v5.12-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 (2021-03-12 11:46:09 -

Re: [Cluster-devel] fs/gfs2/rgrp.c:1772:53: warning: Possible null pointer dereference: minext [nullPointer]

2021-04-02 Thread Andreas Gruenbacher
ility. Reported-by: kernel test robot Signed-off-by: Andreas Gruenbacher --- fs/gfs2/rgrp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 89c37a845e64..2dab313442a7 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c @@ -1783,7 +1783,7 @@ stati

[Cluster-devel] [PATCH] gfs2: Remove unused variable sb_format

2021-04-02 Thread Andreas Gruenbacher
Signed-off-by: Andreas Gruenbacher --- fs/gfs2/incore.h | 1 - fs/gfs2/ops_fstype.c | 1 - 2 files changed, 2 deletions(-) diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index 0957119f7744..8ff70b519687 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h @@ -625,7 +625,6 @@ struct

Re: [Cluster-devel] [PATCH 2/4] gfs2: Turn gfs2_extent_map into gfs2_{get, alloc}_extent

2021-04-01 Thread Andreas Gruenbacher
On Thu, Apr 1, 2021 at 11:46 AM Andrew Price wrote: > On 01/04/2021 10:18, Andreas Gruenbacher wrote: > > Convert gfs2_extent_map to iomap and split it into gfs2_get_extent and > > gfs2_alloc_extent. Instead of hardcoding the extent size, pass it in > > via the extlen para

[Cluster-devel] [PATCH 3/4] gfs2: Replace gfs2_lblk_to_dblk with gfs2_get_extent

2021-04-01 Thread Andreas Gruenbacher
We don't need two very similar functions for mapping logical blocks to physical blocks. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/bmap.c | 24 fs/gfs2/bmap.h | 1 - fs/gfs2/log.c | 6 +- 3 files changed, 5 insertions(+), 26 deletions(-) diff --git a/fs

[Cluster-devel] [PATCH 4/4] gfs2: Turn gfs2_meta_indirect_buffer into gfs2_meta_buffer

2021-04-01 Thread Andreas Gruenbacher
Instead of only supporting GFS2_METATYPE_DI and GFS2_METATYPE_IN blocks, make the block type a parameter of gfs2_meta_indirect_buffer and rename the function to gfs2_meta_buffer. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/bmap.c| 2 +- fs/gfs2/meta_io.c | 9 - fs/gfs2/meta_io.h

[Cluster-devel] [PATCH 2/4] gfs2: Turn gfs2_extent_map into gfs2_{get, alloc}_extent

2021-04-01 Thread Andreas Gruenbacher
Convert gfs2_extent_map to iomap and split it into gfs2_get_extent and gfs2_alloc_extent. Instead of hardcoding the extent size, pass it in via the extlen parameter. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/bmap.c | 59 ++ fs/gfs2/bmap.h

[Cluster-devel] [PATCH 1/4] gfs2: Add new gfs2_iomap_get helper

2021-04-01 Thread Andreas Gruenbacher
Rename the current gfs2_iomap_get and gfs2_iomap_alloc functions to __*. Add a new gfs2_iomap_get helper that doesn't expose struct metapath. Rename gfs2_iomap_get_alloc to gfs2_iomap_alloc. Use the new helpers where they make sense. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/bmap.c

[Cluster-devel] [PATCH 0/4] gfs2: Various cleanups

2021-04-01 Thread Andreas Gruenbacher
Here are a few minor clanups; please review. Thanks, Andreas Andreas Gruenbacher (4): gfs2: Add new gfs2_iomap_get helper gfs2: Turn gfs2_extent_map into gfs2_{get,alloc}_extent gfs2: Replace gfs2_lblk_to_dblk with gfs2_get_extent gfs2: Turn gfs2_meta_indirect_buffer into

Re: [Cluster-devel] [PATCH] gfs2: Flag a withdraw if init_threads() fails

2021-03-15 Thread Andreas Gruenbacher
On Mon, Mar 15, 2021 at 1:24 PM Andrew Price wrote: > Interrupting mount with ^C quickly enough can cause the kthread_run() > calls in gfs2's init_threads() to fail and the error path leads to a > deadlock on the s_umount rwsem. The abridged chain of events is: > > [mount path] > get_tree_bdev

[Cluster-devel] [GIT PULL] gfs2 fixes for 5.12-rc3

2021-03-12 Thread Andreas Gruenbacher
Hi Linus, please consider pulling the following gfs2 fixes. Thanks, Andreas The following changes since commit a38fd8748464831584a19438cbb3082b5a2dab15: Linux 5.12-rc2 (2021-03-05 17:33:41 -0800) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/li

Re: [Cluster-devel] Recording extents in GFS2

2021-03-01 Thread Andreas Gruenbacher
On Tue, Feb 2, 2021 at 6:35 PM Steven Whitehouse wrote: > Hi, > On 24/01/2021 06:44, Abhijith Das wrote: > > Hi all, > > I've been looking at rgrp.c:gfs2_alloc_blocks(), which is called from > various places to allocate single/multiple blocks for inodes. I've come up > with some data structures t

Re: [Cluster-devel] Recording extents in GFS2

2021-02-25 Thread Andreas Gruenbacher
On Thu, Feb 25, 2021 at 7:48 PM Bob Peterson wrote: > - Original Message - > > >> once we change the journal format, in addition to recording block > numbers > > >> as extents, there are some additional issues we should address at the > same > > >> time: > > One thing I've always thought

[Cluster-devel] [GIT PULL] GFS2 changes for 5.12

2021-02-23 Thread Andreas Gruenbacher
ate for each journal"). * Various other bug fixes. -------- Andreas Gruenbacher (37): gfs2: Turn gfs2_rbm_incr into gfs2_rbm_add gfs2: Only use struct gfs2_rbm for bitmap manipulations gfs2: Get rid of unnecessary

Re: [Cluster-devel] [PATCH v4 17/20] gfs2: No revokes for transactions at the tail of the log

2021-02-22 Thread Andreas Gruenbacher
On Wed, Feb 3, 2021 at 7:08 PM Andreas Gruenbacher wrote: > In gfs2_log_flush, we're going through all active transactions. For > each of the buffers in those transactions that has completed, we either > add a revoke to the active transaction immediately or we move the &

Re: [Cluster-devel] Recording extents in GFS2

2021-02-22 Thread Andreas Gruenbacher
On Mon, Feb 22, 2021 at 12:41 PM Andreas Gruenbacher wrote: > On Mon, Feb 22, 2021 at 11:21 AM Steven Whitehouse > wrote: > >> Hi, >> On 20/02/2021 09:48, Andreas Gruenbacher wrote: >> >> Hi all, >> >> once we change the journal format, in addi

Re: [Cluster-devel] Recording extents in GFS2

2021-02-22 Thread Andreas Gruenbacher
On Mon, Feb 22, 2021 at 11:21 AM Steven Whitehouse wrote: > Hi, > On 20/02/2021 09:48, Andreas Gruenbacher wrote: > > Hi all, > > once we change the journal format, in addition to recording block numbers > as extents, there are some additional issues we should address at t

Re: [Cluster-devel] Recording extents in GFS2

2021-02-20 Thread Andreas Gruenbacher
Hi all, once we change the journal format, in addition to recording block numbers as extents, there are some additional issues we should address at the same time: I. The current transaction format of our journals is as follows: - One METADATA log descriptor block for each [503 / 247 / 119 / 5

[Cluster-devel] [PATCH] gfs2: Recursive gfs2_quota_hold in gfs2_iomap_end

2021-02-10 Thread Andreas Gruenbacher
assertion. Instead, move the call to gfs2_quota_unlock before the call to punch_hole to fix that. Fixes: 64bc06bb32ee ("gfs2: iomap buffered write support") Cc: sta...@vger.kernel.org # v4.19+ Signed-off-by: Andreas Gruenbacher --- fs/gfs2/bmap.c | 6 +++--- 1 file changed, 3 inserti

[Cluster-devel] [PATCH] gfs2: Lock imbalance on error path in gfs2_recover_one

2021-02-05 Thread Andreas Gruenbacher
In gfs2_recover_one, fix a sd_log_flush_lock imbalance when a recovery pass fails. Fixes: c9ebc4b73799 ("gfs2: allow journal replay to hold sd_log_flush_lock") Cc: sta...@vger.kernel.org # v5.7+ Signed-off-by: Andreas Gruenbacher --- fs/gfs2/recovery.c | 4 +++- 1 file changed, 3

[Cluster-devel] [PATCH v4 18/20] gfs2: Minor calc_reserved cleanup

2021-02-03 Thread Andreas Gruenbacher
No functional change. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index b80c96cf721a..93ae3da4accb 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -564,17 +564,14 @@ static

[Cluster-devel] [PATCH v4 19/20] gfs2: Rework the log space allocation logic

2021-02-03 Thread Andreas Gruenbacher
available. This will make the log space allocator code easier to work with in the future. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 162 fs/gfs2/log.h | 7 +++ fs/gfs2/trans.c | 5 +- 3 files changed, 105 insertions(+), 6

[Cluster-devel] [PATCH v4 17/20] gfs2: No revokes for transactions at the tail of the log

2021-02-03 Thread Andreas Gruenbacher
we've just written become obsolete. So instead of writing unnecessary revokes, just skip completed transactions at the tail of the log. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 30 -- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/

[Cluster-devel] [PATCH v4 20/20] gfs2: Per-revoke accounting in transactions

2021-02-03 Thread Andreas Gruenbacher
serve more revokes than they will actually need in the end, but now we won't overshoot the target as much, and by only returning the space for excess revokes at log flush time, we further reduce the amount of contention between processes. Signed-off-by: Andreas Gruenbacher --- fs/gf

[Cluster-devel] [PATCH v4 16/20] gfs2: Move function gfs2_ail_empty_tr

2021-02-03 Thread Andreas Gruenbacher
Move this function further up in log.c so that we can use it in the next patch. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 6b5584fd8ff7

[Cluster-devel] [PATCH v4 09/20] gfs2: Clean up on-stack transactions

2021-02-03 Thread Andreas Gruenbacher
Replace the TR_ALLOCED flag by its inverse, TR_ONSTACK: that way, the flag only needs to be set in the exceptional case of on-stack transactions. Split off __gfs2_trans_begin from gfs2_trans_begin and use it to replace the open-coded version in gfs2_ail_empty_gl. Signed-off-by: Andreas

[Cluster-devel] [PATCH v4 10/20] gfs2: Get rid of sd_reserving_log

2021-02-03 Thread Andreas Gruenbacher
. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/incore.h | 3 --- fs/gfs2/log.c| 17 ++--- fs/gfs2/log.h| 1 + fs/gfs2/ops_fstype.c | 2 -- fs/gfs2/super.c | 12 ++-- fs/gfs2/trans.c | 2 ++ 6 files changed, 19 insertions(+), 18 deletions(-) diff

[Cluster-devel] [PATCH v4 15/20] gfs2: Get rid of current_tail()

2021-02-03 Thread Andreas Gruenbacher
Keep the current value of the updated log tail in the super block as sb_log_flush_tail instead of computing it on the fly. This avoids unnecessary sd_ail_lock taking and cleans up the code. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/incore.h | 5 ++-- fs/gfs2/log.c| 72

[Cluster-devel] [PATCH v4 14/20] gfs2: Use a tighter bound in gfs2_trans_begin

2021-02-03 Thread Andreas Gruenbacher
Use a tighter bound for the number of blocks required by transactions in gfs2_trans_begin: in the worst case, we'll have mixed data and metadata, so we'll need a log desciptor for each type. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/trans.c | 10 -- 1 file changed, 8

[Cluster-devel] [PATCH v4 13/20] gfs2: Clean up gfs2_log_reserve

2021-02-03 Thread Andreas Gruenbacher
igned-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 58 + fs/gfs2/trans.c | 3 +-- 2 files changed, 26 insertions(+), 35 deletions(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index cff95889b6f4..ca9fa481913d 100644 --- a/fs/gfs2/log.c +++ b/fs

[Cluster-devel] [PATCH v4 06/20] gfs2: Rename gfs2_{write => flush}_revokes

2021-02-03 Thread Andreas Gruenbacher
Function gfs2_write_revokes doesn't actually write any revokes; instead, it adds revokes to the system transaction during a flush. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 4 ++-- fs/gfs2/log.h | 2 +- fs/gfs2/lops.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)

[Cluster-devel] [PATCH v4 12/20] gfs2: Don't wait for journal flush in clean_journal

2021-02-03 Thread Andreas Gruenbacher
. Signed-off-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 e7183c84ffc0..cff95889b6f4 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -757,7 +757,7 @@ void gfs2_write_log_header(struct gfs2_sbd

[Cluster-devel] [PATCH v4 11/20] gfs2: Move lock flush locking to gfs2_trans_{begin, end}

2021-02-03 Thread Andreas Gruenbacher
Move the read locking of sd_log_flush_lock from gfs2_log_reserve to gfs2_trans_begin, and its unlocking from gfs2_log_release to gfs2_trans_end. Use gfs2_log_release in two places in which it was open coded before. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 28

[Cluster-devel] [PATCH v4 07/20] gfs2: Clean up ail2_empty

2021-02-03 Thread Andreas Gruenbacher
Clean up the logic in ail2_empty (no functional change). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 38 +- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 7375c007bde5..e4dc23a24569 100644 --- a

[Cluster-devel] [PATCH v4 05/20] gfs2: Minor debugging improvement

2021-02-03 Thread Andreas Gruenbacher
Split the assert in gfs2_trans_end into two parts. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/trans.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c index 6d4bf7ea7b3b..7705f04621f4 100644 --- a/fs/gfs2/trans.c +++ b/fs/gfs2/trans.c

[Cluster-devel] [PATCH v4 08/20] gfs2: Use sb_start_intwrite in gfs2_ail_empty_gl

2021-02-03 Thread Andreas Gruenbacher
ert that change. This simplifies the next commit. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/glops.c | 5 - fs/gfs2/trans.c | 8 +++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c index 3faa421568b0..fd1f52fff170 100644 --- a/fs/gfs

[Cluster-devel] [PATCH v4 00/20] Some log space management cleanups

2021-02-03 Thread Andreas Gruenbacher
n asterisk below. Please review. Thanks, Andreas Andreas Gruenbacher (20): gfs2: Un-obfuscate function jdesc_find_i gfs2: Simplify the buf_limit and databuf_limit definitions gfs2: Minor gfs2_write_revokes cleanups gfs2: Some documentation updates gfs2: Minor debugging improvement gf

[Cluster-devel] [PATCH v4 04/20] gfs2: Some documentation updates

2021-02-03 Thread Andreas Gruenbacher
The calc_reserved description claims that buf_limit is 502 (on 4k filesystems), but it is actually 503. Fix / clarify the entire description. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 24 +++- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/fs

[Cluster-devel] [PATCH v4 03/20] gfs2: Minor gfs2_write_revokes cleanups

2021-02-03 Thread Andreas Gruenbacher
Clean up the computations in gfs2_write_revokes (no change in functionality). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 2e9314091c81..ccce17fe605f 100644 --- a/fs/gfs2

[Cluster-devel] [PATCH v4 02/20] gfs2: Simplify the buf_limit and databuf_limit definitions

2021-02-03 Thread Andreas Gruenbacher
The BUF_OFFSET and DATABUF_OFFSET definitions are only used in buf_limit and databuf_limit, respectively, and the rounding done in those definitions is immediately wiped out by dividing by the element size. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/lops.h | 17 ++--- 1 file

[Cluster-devel] [PATCH v4 01/20] gfs2: Un-obfuscate function jdesc_find_i

2021-02-03 Thread Andreas Gruenbacher
Clean up this function to show that it is trivial. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/super.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 2f56acc41c04..ed7a829e9ffe 100644 --- a/fs/gfs2/super.c +++ b/fs

[Cluster-devel] [PATCH v3 20/20] gfs2: Per-revoke accounting in transactions

2021-01-27 Thread Andreas Gruenbacher
than they will actually need in the end, but now we won't overshoot the target as much, and by only returning the space for excess revokes at log flush time, we further reduce the amount of contention between processes. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/glops.c | 8 +--

[Cluster-devel] [PATCH v3 19/20] gfs2: Rework the log space allocation logic

2021-01-27 Thread Andreas Gruenbacher
ne more log flush, which will result in more log space becoming available. This makes the log space allocator code much easier to work with in the future. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 152 fs/gfs2/log.h | 9

[Cluster-devel] [PATCH v3 11/20] gfs2: Don't wait for journal flush in clean_journal

2021-01-27 Thread Andreas Gruenbacher
. Signed-off-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 2e74137322bd..4a2b121b34d0 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -757,7 +757,7 @@ void gfs2_write_log_header(struct gfs2_sbd

[Cluster-devel] [PATCH v3 18/20] gfs2: Remove sd_log_blks_reserved

2021-01-27 Thread Andreas Gruenbacher
Now that sdp->sd_log_tr is defined even when the transaction only indicates revokes, tr_reserved is equivalent to sd_log_blks_reserved, so we can remove it. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/incore.h | 1 - fs/gfs2/log.c| 21 ++--- fs/gfs2/log.h| 2 +-

[Cluster-devel] [PATCH v3 14/20] gfs2: Get rid of current_tail()

2021-01-27 Thread Andreas Gruenbacher
Keep the current value of the updated log tail in the super block as sb_log_flush_tail instead of computing it on the fly. This avoids unnecessary sd_ail_lock taking and cleans up the code. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/incore.h | 5 ++-- fs/gfs2/log.c| 72

[Cluster-devel] [PATCH v3 17/20] gfs2: Remove sd_log_committed_revoke

2021-01-27 Thread Andreas Gruenbacher
s committed so far, and we can use that in calc_reserved instead. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/incore.h | 1 - fs/gfs2/log.c| 27 ++- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h inde

[Cluster-devel] [PATCH v3 12/20] gfs2: Clean up gfs2_log_reserve

2021-01-27 Thread Andreas Gruenbacher
igned-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 58 + fs/gfs2/trans.c | 3 +-- 2 files changed, 26 insertions(+), 35 deletions(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 4a2b121b34d0..24a292065b9c 100644 --- a/fs/gfs2/log.c +++ b/fs

[Cluster-devel] [PATCH v3 15/20] gfs2: Move function gfs2_ail_empty_tr

2021-01-27 Thread Andreas Gruenbacher
Move this function further up in log.c so that we can use it in the next patch. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 1ca5f2c468d5

[Cluster-devel] [PATCH v3 13/20] gfs2: Use a tighter bound in gfs2_trans_begin

2021-01-27 Thread Andreas Gruenbacher
Use a tighter bound for the number of blocks required by transactions in gfs2_trans_begin: in the worst case, we'll have mixed data and metadata, so we'll need a log desciptor for each type. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/trans.c | 10 -- 1 file changed, 8

[Cluster-devel] [PATCH v3 09/20] gfs2: Get rid of sd_reserving_log

2021-01-27 Thread Andreas Gruenbacher
. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/incore.h | 3 --- fs/gfs2/log.c| 17 ++--- fs/gfs2/log.h| 1 + fs/gfs2/ops_fstype.c | 2 -- fs/gfs2/super.c | 12 ++-- fs/gfs2/trans.c | 5 - 6 files changed, 21 insertions(+), 19 deletions(-) diff

[Cluster-devel] [PATCH v3 05/20] gfs2: Minor debugging improvement

2021-01-27 Thread Andreas Gruenbacher
Split the assert in gfs2_trans_end into two parts. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/trans.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c index 6d4bf7ea7b3b..7705f04621f4 100644 --- a/fs/gfs2/trans.c +++ b/fs/gfs2/trans.c

[Cluster-devel] [PATCH v3 07/20] gfs2: Clean up ail2_empty

2021-01-27 Thread Andreas Gruenbacher
Clean up the logic in ail2_empty (no functional change). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 38 +- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 7375c007bde5..e4dc23a24569 100644 --- a

[Cluster-devel] [PATCH v3 04/20] gfs2: Some documentation updates

2021-01-27 Thread Andreas Gruenbacher
The calc_reserved description claims that buf_limit is 502 (on 4k filesystems), but it is actually 503. Fix / clarify the entire description. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 24 +++- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/fs

[Cluster-devel] [PATCH v3 01/20] gfs2: Un-obfuscate function jdesc_find_i

2021-01-27 Thread Andreas Gruenbacher
Clean up this function to show that it is trivial. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/super.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 2f56acc41c04..ed7a829e9ffe 100644 --- a/fs/gfs2/super.c +++ b/fs

[Cluster-devel] [PATCH v3 16/20] gfs2: No revokes for transactions at the tail of the log

2021-01-27 Thread Andreas Gruenbacher
okes we've just written immediately become obsolete. (This is not the case for transactions that haven't completed or aren't at the tail of the log.) Fix this by skipping completed transactions at the tail of the log instead of writing revokes for them. Signed-off-by: Andreas Gruenb

[Cluster-devel] [PATCH v3 02/20] gfs2: Simplify the buf_limit and databuf_limit definitions

2021-01-27 Thread Andreas Gruenbacher
The BUF_OFFSET and DATABUF_OFFSET definitions are only used in buf_limit and databuf_limit, respectively, and the rounding done in those definitions is immediately wiped out by dividing by the element size. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/lops.h | 17 ++--- 1 file

[Cluster-devel] [PATCH v3 08/20] gfs2: Get rid of on-stack transactions

2021-01-27 Thread Andreas Gruenbacher
we skip the __gfs2_ail_flush, we'll just end up with leftover items on gl_ail_list. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/glops.c | 29 +++-- fs/gfs2/incore.h | 1 - fs/gfs2/log.c| 1 - fs/gfs2/trans.c | 25 + fs/gfs2/tran

[Cluster-devel] [PATCH v3 00/20] Some log space management cleanups

2021-01-27 Thread Andreas Gruenbacher
Hello, here's another update on the log log space management cleanup. The changes are mostly in the topmost patch ("gfs2: Per-revoke accounting in transactions"), which still had several bugs in v2. Please review. Thanks, Andreas Andreas Gruenbacher (20): gfs2: Un-obf

[Cluster-devel] [PATCH v3 10/20] gfs2: Move lock flush locking to gfs2_trans_{begin, end}

2021-01-27 Thread Andreas Gruenbacher
Move the read locking of sd_log_flush_lock from gfs2_log_reserve to gfs2_trans_begin, and its unlocking from gfs2_log_release to gfs2_trans_end. Use gfs2_log_release in two places in which it was open coded before. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 28

[Cluster-devel] [PATCH v3 06/20] gfs2: Rename gfs2_{write => flush}_revokes

2021-01-27 Thread Andreas Gruenbacher
Function gfs2_write_revokes doesn't actually write any revokes; instead, it adds revokes to the system transaction during a flush. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 4 ++-- fs/gfs2/log.h | 2 +- fs/gfs2/lops.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)

[Cluster-devel] [PATCH v3 03/20] gfs2: Minor gfs2_write_revokes cleanups

2021-01-27 Thread Andreas Gruenbacher
Clean up the computations in gfs2_write_revokes (no change in functionality). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 2e9314091c81..ccce17fe605f 100644 --- a/fs/gfs2

Re: [Cluster-devel] [GFS2 PATCH] gfs2: make recovery workqueue operate on a gfs2 mount point, not journal

2021-01-19 Thread Andreas Gruenbacher
On Tue, Jan 19, 2021 at 7:18 PM Bob Peterson wrote: > - Original Message - > > On Tue, Jan 19, 2021 at 4:44 PM Bob Peterson wrote: > > > Sure, the recovery workers' bio allocations and submitting may be > > > serialized, > > > but that's where it ends. The recovery workers don't prevent r

Re: [Cluster-devel] [GFS2 PATCH] gfs2: make recovery workqueue operate on a gfs2 mount point, not journal

2021-01-19 Thread Andreas Gruenbacher
On Tue, Jan 19, 2021 at 4:44 PM Bob Peterson wrote: > Sure, the recovery workers' bio allocations and submitting may be serialized, > but that's where it ends. The recovery workers don't prevent races with each > other when using the variable common to all of them: sdp->sd_log_bio. > This is the c

Re: [Cluster-devel] [GFS2 PATCH] gfs2: make recovery workqueue operate on a gfs2 mount point, not journal

2021-01-19 Thread Andreas Gruenbacher
On Mon, Jan 4, 2021 at 5:09 PM Bob Peterson wrote: > > Hi, > > - Original Message - > > Hi, > > > > On 22/12/2020 20:38, Bob Peterson wrote: > > > Hi, > > > > > > Before this patch, journal recovery was done by a workqueue function that > > > operated on a per-journal basis. The problem is

Re: [Cluster-devel] [PATCH] gfs2: Fix invalid block size message

2021-01-12 Thread Andreas Gruenbacher
On Tue, Jan 12, 2021 at 12:47 PM Andrew Price wrote: > Signed-off-by: Andrew Price > --- > fs/gfs2/ops_fstype.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c > index 64ad19bb978c..5a0fde5e67d9 100644 > --- a/fs/gfs2/ops_fstyp

Re: [Cluster-devel] [GFS2 PATCH 2/2] gfs2: move freeze glock outside the make_fs_rw and _ro functions

2020-12-22 Thread Andreas Gruenbacher
On Tue, Dec 22, 2020 at 9:43 PM Bob Peterson wrote: > > Before this patch, sister functions gfs2_make_fs_rw and gfs2_make_fs_ro locked > (held) the freeze glock by calling gfs2_freeze_lock and gfs2_freeze_unlock. > The problem is, not all the callers of gfs2_make_fs_ro should be doing this. > The

Re: [Cluster-devel] [GFS2 PATCH] gfs2: make recovery workqueue operate on a gfs2 mount point, not journal

2020-12-22 Thread Andreas Gruenbacher
On Tue, Dec 22, 2020 at 9:39 PM Bob Peterson wrote: > > Hi, > > Before this patch, journal recovery was done by a workqueue function that > operated on a per-journal basis. The problem is, these could run > simultaneously > which meant that they could all use the same bio, sd_log_bio, to do their

Re: [Cluster-devel] [PATCH v2 12/20] gfs2: Clean up gfs2_log_reserve

2020-12-22 Thread Andreas Gruenbacher
d. > > > > Check if enough log space is immeditely available before anything else. If > > there isn't, use io_wait_event to wait instead of open-coding it. > > > > Signed-off-by: Andreas Gruenbacher > > --- > > fs/gfs2/log.c | 54

[Cluster-devel] [GIT PULL] GFS2 changes for 5.11

2020-12-19 Thread Andreas Gruenbacher
care. Andreas Gruenbacher (2): gfs2: Make inode operations static Revert "GFS2: Prevent delete work from occurring on glocks used for create" Andrew Price (2): Documentation: Update filesystems/gfs2.rst MAINTAINERS: Add gfs2 bug tracker link

[Cluster-devel] [PATCH v2 20/20] gfs2: Hand out revokes to transactions one by one

2020-12-19 Thread Andreas Gruenbacher
more revokes than they will actually need in the end, but now we won't overshoot the target as much, and by only returning the space for excess revokes at log flush time, we further reduce the amount of contention between processes. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/incore.h

[Cluster-devel] [PATCH v2 19/20] gfs2: Rework the log space allocation logic

2020-12-19 Thread Andreas Gruenbacher
ne more log flush, which will result in more log space becoming available. This makes the log space allocator code much easier to work with in the future. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 163 fs/gfs2/log.h | 9

[Cluster-devel] [PATCH v2 18/20] gfs2: Remove sd_log_blks_reserved

2020-12-19 Thread Andreas Gruenbacher
Now that sdp->sd_log_tr is defined even when the transaction only indicates revokes, tr_reserved is equivalent to sd_log_blks_reserved, so we can remove it. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/incore.h | 1 - fs/gfs2/log.c| 21 ++--- fs/gfs2/log.h| 2 +-

[Cluster-devel] [PATCH v2 17/20] gfs2: Remove sd_log_committed_revoke

2020-12-19 Thread Andreas Gruenbacher
s committed so far, and we can use that in calc_reserved instead. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/incore.h | 1 - fs/gfs2/log.c| 27 ++- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h inde

[Cluster-devel] [PATCH v2 16/20] gfs2: No revokes for transactions at the tail of the log

2020-12-19 Thread Andreas Gruenbacher
okes we've just written immediately become obsolete. (This is not the case for transactions that haven't completed or aren't at the tail of the log.) Fix this by skipping completed transactions at the tail of the log instead of writing revokes for them. Signed-off-by: Andreas Gruenb

[Cluster-devel] [PATCH v2 15/20] gfs2: Move function gfs2_ail_empty_tr

2020-12-19 Thread Andreas Gruenbacher
Move this function further up in log.c so that we can use it in the next patch. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 47a25833acf3

[Cluster-devel] [PATCH v2 14/20] gfs2: Get rid of current_tail()

2020-12-19 Thread Andreas Gruenbacher
Keep the current value of the updated log tail in the super block as sb_log_flush_tail instead of computing it on the fly. This avoids unnecessary sd_ail_lock taking and cleans up the code. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/incore.h | 5 ++-- fs/gfs2/log.c| 72

[Cluster-devel] [PATCH v2 13/20] gfs2: Use a tighter bound in gfs2_trans_begin

2020-12-19 Thread Andreas Gruenbacher
Use a tighter bound for the number of blocks required by transactions in gfs2_trans_begin: in the worst case, we'll have mixed data and metadata, so we'll need a log desciptor for each type. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/trans.c | 10 -- 1 file changed, 8

[Cluster-devel] [PATCH v2 11/20] gfs2: Don't wait for journal flush in clean_journal

2020-12-19 Thread Andreas Gruenbacher
. Signed-off-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 88f9d630fb96..95ad444bd3dc 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -757,7 +757,7 @@ void gfs2_write_log_header(struct gfs2_sbd

[Cluster-devel] [PATCH v2 12/20] gfs2: Clean up gfs2_log_reserve

2020-12-19 Thread Andreas Gruenbacher
igned-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 54 ++- 1 file changed, 23 insertions(+), 31 deletions(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 95ad444bd3dc..7a65823ad1f3 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -420,6 +

[Cluster-devel] [PATCH v2 10/20] gfs2: Move lock flush locking to gfs2_trans_{begin, end}

2020-12-19 Thread Andreas Gruenbacher
Move the read locking of sd_log_flush_lock from gfs2_log_reserve to gfs2_trans_begin, and its unlocking from gfs2_log_release to gfs2_trans_end. Use gfs2_log_release in two places in which it was open coded before. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 28

[Cluster-devel] [PATCH v2 09/20] gfs2: Get rid of sd_reserving_log

2020-12-19 Thread Andreas Gruenbacher
. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/incore.h | 3 --- fs/gfs2/log.c| 17 ++--- fs/gfs2/log.h| 1 + fs/gfs2/ops_fstype.c | 2 -- fs/gfs2/super.c | 12 ++-- fs/gfs2/trans.c | 5 - 6 files changed, 21 insertions(+), 19 deletions(-) diff

[Cluster-devel] [PATCH v2 08/20] gfs2: Get rid of on-stack transactions

2020-12-19 Thread Andreas Gruenbacher
we skip the __gfs2_ail_flush, we'll just end up with leftover items on gl_ail_list. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/glops.c | 29 +++-- fs/gfs2/incore.h | 1 - fs/gfs2/log.c| 1 - fs/gfs2/trans.c | 25 + fs/gfs2/tran

[Cluster-devel] [PATCH v2 07/20] gfs2: Clean up ail2_empty

2020-12-19 Thread Andreas Gruenbacher
Clean up the logic in ail2_empty (no functional change). Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 38 +- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 8efc0c1c5c87..d7b0dc94fc8c 100644 --- a

[Cluster-devel] [PATCH v2 06/20] gfs2: Rename gfs2_{write => add_aux}_revokes

2020-12-19 Thread Andreas Gruenbacher
Function gfs2_write_revokes doesn't actually write any revokes; instead, it adds auxiliary revokes to the system transaction. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 4 ++-- fs/gfs2/log.h | 2 +- fs/gfs2/lops.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)

[Cluster-devel] [PATCH v2 04/20] gfs2: Some documentation updates

2020-12-19 Thread Andreas Gruenbacher
The calc_reserved description claims that buf_limit is 502 (on 4k filesystems), but it is actually 503. Fix / clarify the entire description. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 24 +++- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/fs

<    1   2   3   4   5   6   7   8   9   10   >