[Cluster-devel] [PATCH v2 3/6] gfs2: Iomap cleanups and improvements

2018-01-29 Thread Andreas Gruenbacher
Clean up gfs2_iomap_alloc and gfs2_iomap_get. Document how gfs2_iomap_alloc works. gfs2_iomap_alloc now needs to be called separately after gfs2_iomap_get where necessary; this will be used later by iomap write. Move gfs2_iomap_ops into bmap.c. Signed-off-by: Andreas Gruenbacher

[Cluster-devel] [PATCH v2 4/6] iomap: Add write_{begin, end} iomap operations

2018-01-29 Thread Andreas Gruenbacher
Add write_begin and write_end operations to struct iomap_ops to provide a way of overriding the default behavior of iomap_write_begin and iomap_write_end. This is needed for implementing data journaling: in the data journaling case, pages are written into the journal before being written back to

[Cluster-devel] [PATCH v2 2/6] gfs2: Remove ordered write mode handling from gfs2_trans_add_data

2018-01-29 Thread Andreas Gruenbacher
In journaled data mode, we need to add each buffer head to the current transaction. In ordered write mode, we only need to add the inode to the ordered inode list. So far, both cases are handled in gfs2_trans_add_data. This makes the code look misleading and is inefficient for small block sizes

[Cluster-devel] [PATCH v2 5/6] gfs2: Implement iomap buffered write support (1)

2018-01-29 Thread Andreas Gruenbacher
With the traditional page-based writes, blocks are allocated separately for each page written to. With iomap writes, we can allocate a lot more blocks at once, with a fraction of the allocation overhead for each page. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/aops.c |

[Cluster-devel] [PATCH v2 6/6] gfs2: Implement iomap buffered write support (2)

2018-01-29 Thread Andreas Gruenbacher
Instead of falling back to generic_file_write_iter when writing to a stuffed file that stays stuffed, implement that case separately. We eventually want to get rid of the remaining users of gfs2_write_begin + gfs2_write_end so that those functions can eventually be removed, and

[Cluster-devel] [PATCH v2 0/6] gfs2 iomap buffered write support

2018-01-29 Thread Andreas Gruenbacher
Hello, this patch queue converts gfs2 to use iomap for buffered writes, which uses multi-page block allocations for large writes instead of a separate allocation for each page of data. Apply on top of the current gfs2 for-next branch:

[Cluster-devel] [PATCH v2 1/6] gfs2: gfs2_stuffed_write_end cleanup

2018-01-29 Thread Andreas Gruenbacher
First, change the sanity check in gfs2_stuffed_write_end to check for the actual write size instead of the requested write size. Second, use the existing teardown code in gfs2_write_end instead of duplicating it in gfs2_stuffed_write_end. Signed-off-by: Andreas Gruenbacher

[Cluster-devel] [PATCH] gfs2: Add a few missing newlines in messages

2018-01-29 Thread Andreas Gruenbacher
Some of the info, warning, and error messages are missing their trailing newline. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/lock_dlm.c | 4 ++-- fs/gfs2/rgrp.c | 2 +- fs/gfs2/sys.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git

[Cluster-devel] [PATCH] gfs2: Warn when log is stuck

2018-01-29 Thread Andreas Gruenbacher
Warn when a log space reservation is stuck for more than 60 seconds. Signed-off-by: Andreas Gruenbacher --- fs/gfs2/log.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index cf6b46247df4..3e3bc63f5377

Re: [Cluster-devel] [GFS2 PATCH] gfs2: Remove inode from ordered write list in gfs2_write_inode()

2018-01-29 Thread Steven Whitehouse
Hi, Looks good. Do you have any figures for how big a reduction in inodes on the order list this gives? Steve. On 29/01/18 05:02, Abhi Das wrote: The vfs clears the I_DIRTY inode flag before calling gfs2_write_inode() having queued any data that needed to be written to disk. This is a good

Re: [Cluster-devel] [PATCH v2 0/3] gfs2: Add new resource group header fields

2018-01-29 Thread Bob Peterson
Hi Andy, - Original Message - | I've just realised that these aren't in for-next despite the positive | response. Can they get in for the upcoming merge window? Your three patches are indeed already included in for-next and have been for some time. I'm not sure why you're not seeing

Re: [Cluster-devel] [PATCH v2 0/3] gfs2: Add new resource group header fields

2018-01-29 Thread Andrew Price
On 29/01/18 13:30, Bob Peterson wrote: Hi Andy, - Original Message - | I've just realised that these aren't in for-next despite the positive | response. Can they get in for the upcoming merge window? Your three patches are indeed already included in for-next and have been for some

Re: [Cluster-devel] [GFS2 PATCH] gfs2: Remove inode from ordered write list in gfs2_write_inode()

2018-01-29 Thread Abhijith Das
- Original Message - > From: "Steven Whitehouse" > To: "Abhi Das" , cluster-devel@redhat.com > Sent: Monday, January 29, 2018 3:46:39 AM > Subject: Re: [Cluster-devel] [GFS2 PATCH] gfs2: Remove inode from ordered > write list in gfs2_write_inode() >

[Cluster-devel] [PATCH 19/27] gfs2: Turn trunc_dealloc into punch_hole

2018-01-29 Thread Bob Peterson
From: Andreas Gruenbacher Add an upper bound to the range of blocks to deallocate blocks to function trunc_dealloc so that this function can be used for truncating a file as well as for punching a hole into a file. Signed-off-by: Andreas Gruenbacher

[Cluster-devel] [PATCH 25/27] GFS2: Introduce new gfs2_log_header_v2

2018-01-29 Thread Bob Peterson
This patch adds a new structure called gfs2_log_header_v2 which is used to store expanded fields into previously unused areas of the log headers (i.e., this change is backwards compatible). Some of these are used for debug purposes so we can backtrack when problems occur. Others are reserved for

[Cluster-devel] [PATCH 07/27] GFS2: Reduce code redundancy writing log headers

2018-01-29 Thread Bob Peterson
Before this patch, there was a lot of code redundancy between functions log_write_header (which uses bio) and clean_journal (which uses buffer_head). This patch reduces the redundancy to simplify the code and make log header writing more consistent. We want more consistency and reduced redundancy

[Cluster-devel] [PATCH 22/27] gfs2: Add gfs2_max_stuffed_size

2018-01-29 Thread Bob Peterson
From: Andreas Gruenbacher Add a small inline function for computing the maximum size of a stuffed inode instead of open coding that in several places throughout the code. Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson

[Cluster-devel] [PATCH 15/27] gfs2: Fix metadata read-ahead during truncate

2018-01-29 Thread Bob Peterson
From: Andreas Gruenbacher The metadata read-ahead algorithm broke when switching from recursive to non-recursive delete: the current algorithm reads ahead blocks at height N - 1 while deallocating the blocks at hight N. However, deallocating the blocks at height N requires

[Cluster-devel] [PATCH 20/27] gfs2: Implement fallocate(FALLOC_FL_PUNCH_HOLE)

2018-01-29 Thread Bob Peterson
From: Andreas Gruenbacher Implement the top-level bits of punching a hole into a file. Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson --- fs/gfs2/bmap.c | 122

[Cluster-devel] [PATCH 16/27] gfs2: Improve non-recursive delete algorithm

2018-01-29 Thread Bob Peterson
From: Andreas Gruenbacher In rare cases, the current non-recursive delete algorithm doesn't deallocate empty intermediary indirect blocks. This should have very little practical effect, but deallocating all blocks correctly should still be preferable as it is cleaner and

[Cluster-devel] [PATCH 27/27] GFS2: Fix minor comment typo

2018-01-29 Thread Bob Peterson
Signed-off-by: Bob Peterson --- fs/gfs2/lops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 4a60221c678f..4d6567990baf 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@ -162,7 +162,7 @@ u64 gfs2_log_bmap(struct

[Cluster-devel] [PATCH 09/27] gfs2: Add gfs2_blk2rgrpd comment and fix incorrect use

2018-01-29 Thread Bob Peterson
From: Steven Whitehouse Document when to use gfs2_blk2rgrpd for "inexact" resource group matching. Based on that, fix an incorrect use of gfs2_blk2rgrpd in sweep_bh_for_rgrps. Signed-off-by: Steven Whitehouse Signed-off-by: Andreas Gruenbacher

[Cluster-devel] [PATCH 26/27] GFS2: Log the reason for log flushes in every log header

2018-01-29 Thread Bob Peterson
This patch just adds the capability for GFS2 to track which function called gfs2_log_flush. This should make it easier to diagnose problems based on the sequence of events found in the journals. Signed-off-by: Bob Peterson Reviewed-by: Andreas Gruenbacher

[Cluster-devel] [PATCH 01/27] GFS2: Combine gfs2_free_di with gfs2_free_uninit_di

2018-01-29 Thread Bob Peterson
Before this patch, function gfs2_free_di was 4 lines of code, and one of those lines was to call gfs2_free_uninit_di. Although unlikely, if function gfs2_free_uninit_di encountered an error finding the block to be freed, the error was silently ignored by the caller, which went ahead and improperly

[Cluster-devel] [PATCH 11/27] gfs2: Clean up trunc_start error path

2018-01-29 Thread Bob Peterson
From: Andreas Gruenbacher Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson --- fs/gfs2/bmap.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index

[Cluster-devel] [PATCH 12/27] gfs2: truncate: Remove unnecessary oldsize parameters

2018-01-29 Thread Bob Peterson
From: Andreas Gruenbacher Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson --- fs/gfs2/bmap.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c

[Cluster-devel] [PATCH 14/27] gfs2: Clean up {lookup, fillup}_metapath

2018-01-29 Thread Bob Peterson
From: Andreas Gruenbacher Split out the entire lookup loop from lookup_metapath and fillup_metapath. Make both functions return the actual height in mp->mp_aheight, and return 0 on success. Handle lookup errors properly in trunc_dealloc. Signed-off-by: Andreas Gruenbacher

[Cluster-devel] [PATCH 18/27] gfs2: Generalize truncate code

2018-01-29 Thread Bob Peterson
From: Andreas Gruenbacher Pull the code for computing the range of metapointers to iterate out of gfs2_metapath_ra (for readahead), sweep_bh_for_rgrps (for deallocating metapointers within a block), and trunc_dealloc (for walking the metadata tree). In sweep_bh_for_rgrps,

[Cluster-devel] [PATCH 17/27] Turn gfs2_block_truncate_page into gfs2_block_zero_range

2018-01-29 Thread Bob Peterson
From: Andreas Gruenbacher Turn gfs2_block_truncate_page into a function that zeroes a range within a block rather than only the end of a block. This will be used for cleaning the end of the first partial block and the start of the last partial block when punching a hole in

[Cluster-devel] [PATCH 23/27] gfs2: Minor gfs2_page_add_databufs cleanup

2018-01-29 Thread Bob Peterson
From: Andreas Gruenbacher The to parameter of gfs2_page_add_databufs is passed inconsistently: once as from + len, once as from + len - 1. Just pass len instead. In addition, once we're past the end, we can immediately break out of the loop. Signed-off-by: Andreas

[Cluster-devel] [PATCH 06/27] gfs2: Add a crc field to resource group headers

2018-01-29 Thread Bob Peterson
From: Andrew Price Add the rg_crc field to store a crc32 of the gfs2_rgrp structure. This allows us to check resource group headers' integrity and removes the requirement to check them against the rindex entries in fsck. If this field is found to be zero, it should be ignored

[Cluster-devel] [PATCH 10/27] gfs2: Remove pointless BUG_ON

2018-01-29 Thread Bob Peterson
From: Andreas Gruenbacher The current transaction is being dereferenced before asserting that is not NULL; that isn't going to help. Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson --- fs/gfs2/trans.c | 1 - 1 file

[Cluster-devel] [PATCH 13/27] gfs2: Remove minor gfs2_journaled_truncate inefficiencies

2018-01-29 Thread Bob Peterson
From: Andreas Gruenbacher First, this function truncates the file in chunks. When the original file size isn't block aligned, each chunk that is truncated will remain be misaligned. This is inefficient. Second, this function doesn't recognize where holes are, so it loops

[Cluster-devel] [PATCH 04/27] gfs2: Add a next-resource-group pointer to resource groups

2018-01-29 Thread Bob Peterson
From: Andrew Price Add a new rg_skip field to struct gfs2_rgrp, replacing __pad. The rg_skip field has the following meaning: - If rg_skip is zero, it is considered unset and not useful. - If rg_skip is non-zero, its value will be the number of blocks between this rgrp's

[Cluster-devel] [PATCH 03/27] gfs2: Remove unused gfs2_write_jdata_pagevec parameter

2018-01-29 Thread Bob Peterson
From: Andreas Gruenbacher As a follow-up to commit d2bc5b3c67a9, remove the end parameter which is now unused. Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson --- fs/gfs2/aops.c | 5 ++--- 1 file changed, 2

[Cluster-devel] [PATCH 00/27] GFS2: Pre-pull patch posting (merge window)

2018-01-29 Thread Bob Peterson
Hi, We've got 27 patches for this merge window. These generally fall into four categories: (1) code cleanups, (2) patches related to adding PUNCH_HOLE support to GFS2, (3) support for new fields in resource group headers, and (4) support for new fields in journal log headers. These new fields,

[Cluster-devel] [PATCH 08/27] gfs2: Trim the ordered write list in gfs2_ordered_write()

2018-01-29 Thread Bob Peterson
From: Abhi Das We iterate through the entire ordered writes list in gfs2_ordered_write() to write out inodes. It's a good place to try and shrink the list by throwing out inodes that don't have any pages. Signed-off-by: Abhi Das Acked-by: Steven Whitehouse

[Cluster-devel] [PATCH 02/27] gfs2: Fix wrong error handling in init_gfs2_fs()

2018-01-29 Thread Bob Peterson
From: Tetsuo Handa init_gfs2_fs() is calling e.g. calling unregister_shrinker() without register_shrinker() when an error occurred during initialization. Rename goto labels and call appropriate undo function. Signed-off-by: Tetsuo Handa

[Cluster-devel] [PATCH 21/27] gfs2: Typo fixes

2018-01-29 Thread Bob Peterson
From: Andreas Gruenbacher Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson --- fs/gfs2/aops.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index

[Cluster-devel] [PATCH 24/27] gfs2: Get rid of gfs2_log_header_in

2018-01-29 Thread Bob Peterson
From: Andreas Gruenbacher Get rid of gfs2_log_header_in by integrating it into get_log_header. Clean up the crc32 computations and use the same functions for encoding and decoding to make things less confusing. Eliminate lh_hash from gfs2_log_header_host which is completely

[Cluster-devel] [PATCH 05/27] gfs2: Add rindex fields to rgrp headers

2018-01-29 Thread Bob Peterson
From: Andrew Price Add rg_data0, rg_data and rg_bitbytes to struct gfs2_rgrp. The fields are identical to their counterparts in struct gfs2_rindex and are intended to reduce the use of the rindex. For now the fields are only written back as the in-memory equivalents in struct

[Cluster-devel] GFS2: Don't try to end a non-existent transaction in unlink

2018-01-29 Thread Bob Peterson
Hi, Before this patch, if function gfs2_unlink failed to get a valid transaction (for example, not enough journal blocks) it would go to label out_end_trans which did gfs2_trans_end. But if the trans_begin failed, there's no transaction to end, and trying to do so results in: kernel BUG at

Re: [Cluster-devel] GFS2: Don't try to end a non-existent transaction in unlink

2018-01-29 Thread Andreas Gruenbacher
On 29 January 2018 at 18:07, Bob Peterson wrote: > Hi, > > Before this patch, if function gfs2_unlink failed to get a valid > transaction (for example, not enough journal blocks) it would go > to label out_end_trans which did gfs2_trans_end. But if the > trans_begin failed,