03 Sep, 2019

1 commit

  • This patch fixes three places in which temporary character buffers
    could overflow due to the addition of the file system id from patch
    3792ce973f07. Thanks to Dan Carpenter for pointing it out.

    Signed-off-by: Bob Peterson
    Signed-off-by: Andreas Gruenbacher

    Bob Peterson
     

28 Jun, 2019

2 commits

  • This patch replaces a few leftover printk errors with calls to
    fs_info and similar, so that the file system having the error is
    properly logged.

    Signed-off-by: Bob Peterson
    Signed-off-by: Andreas Gruenbacher

    Bob Peterson
     
  • Before this patch, if a glock error was encountered, the glock with
    the problem was dumped. But sometimes you may have lots of file systems
    mounted, and that doesn't tell you which file system it was for.

    This patch adds a new boolean parameter fsid to the dump_glock family
    of functions. For non-error cases, such as dumping the glocks debugfs
    file, the fsid is not dumped in order to keep lock dumps and glocktop
    as clean as possible. For all error cases, such as GLOCK_BUG_ON, the
    file system id is now printed. This will make it easier to debug.

    Signed-off-by: Bob Peterson
    Signed-off-by: Andreas Gruenbacher

    Bob Peterson
     

05 Jun, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this copyrighted material is made available to anyone wishing to use
    modify copy or redistribute it subject to the terms and conditions
    of the gnu general public license version 2

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 44 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190531081038.653000175@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

08 May, 2019

2 commits

  • Rename gfs2_trans_add_unrevoke to gfs2_trans_remove_revoke: there is no
    such thing as an "unrevoke" object; all this function does is remove
    existing revoke objects plus some bookkeeping.

    Signed-off-by: Andreas Gruenbacher

    Andreas Gruenbacher
     
  • Fix the resource group wrap-around logic in gfs2_rbm_find that commit
    e579ed4f44 broke. The bug can lead to unnecessary repeated scanning of the
    same bitmaps; there is a risk that future changes will turn this into an
    endless loop.

    This is an updated version of commit 2d29f6b96d ("gfs2: Fix loop in
    gfs2_rbm_find") which ended up being reverted because it introduced a
    performance regression in iozone (see commit e74c98ca2d). Changes since v1:

    - Simplify the wrap-around logic.

    - Handle the case where each resource group only has a single bitmap block
    (small filesystem).

    - Update rd_extfail_pt whenever we scan the entire bitmap, even when we don't
    start the scan at the very beginning of the bitmap.

    Fixes: e579ed4f446e ("GFS2: Introduce rbm field bii")
    Signed-off-by: Andreas Gruenbacher

    Andreas Gruenbacher
     

01 Feb, 2019

1 commit

  • This reverts commit 2d29f6b96d8f80322ed2dd895bca590491c38d34.

    It turns out that the fix can lead to a ~20 percent performance regression
    in initial writes to the page cache according to iozone. Let's revert this
    for now to have more time for a proper fix.

    Cc: stable@vger.kernel.org # v3.13+
    Signed-off-by: Andreas Gruenbacher
    Signed-off-by: Bob Peterson
    Signed-off-by: Linus Torvalds

    Andreas Gruenbacher
     

12 Dec, 2018

2 commits

  • This patch is based on an idea from Steve Whitehouse. The idea is
    to dump the number of pages for inodes in the glock dumps.
    The additional locking required me to drop const from quite a few
    places.

    Signed-off-by: Bob Peterson
    Signed-off-by: Andreas Gruenbacher

    Bob Peterson
     
  • Fix the resource group wrap-around logic in gfs2_rbm_find that commit
    e579ed4f44 broke. The bug can lead to unnecessary repeated scanning of the
    same bitmaps; there is a risk that future changes will turn this into an
    endless loop.

    Fixes: e579ed4f44 ("GFS2: Introduce rbm field bii")
    Cc: stable@vger.kernel.org # v3.13+
    Signed-off-by: Andreas Gruenbacher
    Signed-off-by: Bob Peterson

    Andreas Gruenbacher
     

09 Nov, 2018

1 commit

  • gfs2_put_super calls gfs2_clear_rgrpd to destroy the gfs2_rgrpd objects
    attached to the resource group glocks. That function should release the
    buffers attached to the gfs2_bitmap objects (bi_bh), but the call to
    gfs2_rgrp_brelse for doing that is missing.

    When gfs2_releasepage later runs across these buffers which are still
    referenced, it refuses to free them. This causes the pages the buffers
    are attached to to remain referenced as well. With enough mount/unmount
    cycles, the system will eventually run out of memory.

    Fix this by adding the missing call to gfs2_rgrp_brelse in
    gfs2_clear_rgrpd.

    (Also fix a gfs2_rgrp_relse -> gfs2_rgrp_brelse typo in a comment.)

    Fixes: 39b0f1e92908 ("GFS2: Don't brelse rgrp buffer_heads every allocation")
    Cc: stable@vger.kernel.org # v4.2+
    Signed-off-by: Andreas Gruenbacher

    Andreas Gruenbacher
     

12 Oct, 2018

9 commits


06 Oct, 2018

1 commit

  • Before this patch, various errors and messages were reported using
    the pr_* functions: pr_err, pr_warn, pr_info, etc., but that does
    not tell you which gfs2 mount had the problem, which is often vital
    to debugging. This patch changes the calls from pr_* to fs_* in
    most of the messages so that the file system id is printed along
    with the message.

    Signed-off-by: Bob Peterson

    Bob Peterson
     

29 Aug, 2018

2 commits

  • The GFS2_RDF_UPTODATE flag in the rgrp is used to determine when
    a rgrp buffer is valid. It's cleared when the glock is invalidated,
    signifying that the buffer data is now invalid. But before this
    patch, function update_rgrp_lvb was setting the flag when it
    determined it had a valid lvb. But that's an invalid assumption:
    just because you have a valid lvb doesn't mean you have valid
    buffers. After all, another node may have made the lvb valid,
    and this node just fetched it from the glock via dlm.

    Consider this scenario:
    1. The file system is mounted with RGRPLVB option.
    2. In gfs2_inplace_reserve it locks the rgrp glock EX, but thanks
    to GL_SKIP, it skips the gfs2_rgrp_bh_get.
    3. Since loops == 0 and the allocation target (ap->target) is
    bigger than the largest known chunk of blocks in the rgrp
    (rs->rs_rbm.rgd->rd_extfail_pt) it skips that rgrp and bypasses
    the call to gfs2_rgrp_bh_get there as well.
    4. update_rgrp_lvb sees the lvb MAGIC number is valid, so bypasses
    gfs2_rgrp_bh_get, but it still sets sets GFS2_RDF_UPTODATE due
    to this invalid assumption.
    5. The next time update_rgrp_lvb is called, it sees the bit is set
    and just returns 0, assuming both the lvb and rgrp are both
    uptodate. But since this is a smaller allocation, or space has
    been freed by another node, thus adjusting the lvb values,
    it decides to use the rgrp for allocations, with invalid rd_free
    due to the fact it was never updated.

    This patch changes update_rgrp_lvb so it doesn't set the UPTODATE
    flag anymore. That way, it has no choice but to fetch the latest
    values.

    Signed-off-by: Bob Peterson

    Bob Peterson
     
  • Before this patch, gfs2_rgrp_bh_get would check for lvb mismatches,
    but it wouldn't tell you what was actually wrong. This patch adds
    more information to help us debug it. It also makes rgrp consistency
    checks dump any bad rgrps, and the rgrp dump code dump any lvbs
    as well as the rgrp itself.

    Signed-off-by: Bob Peterson
    Acked-by: Steven Whitehouse

    Bob Peterson
     

08 Aug, 2018

1 commit


07 Aug, 2018

1 commit

  • Function gfs2_testbit is called in three places. Two of those places,
    gfs2_alloc_extent and gfs2_unaligned_extlen, should be using the clone
    bitmaps, not the "real" bitmaps. Function gfs2_unaligned_extlen is used
    by the block reservations scheme to determine the length of an extent of
    free blocks. Before this patch, it wasn't using the clone bitmap, which
    means recently-freed blocks were treated as free blocks for the purposes
    of an allocation.

    This patch adds a new parameter to gfs2_testbit to indicate whether or
    not the clone bitmaps should be used (if available).

    Signed-off-by: Bob Peterson
    Reviewed-by: Andreas Gruenbacher

    Bob Peterson
     

27 Jul, 2018

1 commit


25 Jul, 2018

3 commits

  • Before this patch, several functions in rgrp.c checked the value of
    rgd->rd_free_clone. That does not take into account blocks that were
    reserved by a multi-block reservation. This causes a problem when
    space gets tight in the file system. For example, when function
    gfs2_inplace_reserve checks to see if a rgrp has enough blocks to
    satisfy the request, it can accept a rgrp that it should reject
    because, although there are enough blocks to satisfy the request
    _now_, those blocks may be reserved for another running process.

    A second problem with this occurs when we've reserved the remaining
    blocks in an rgrp: function rg_mblk_search() can reject an rgrp
    improperly because it calculates:

    u32 free_blocks = rgd->rd_free_clone - rgd->rd_reserved;

    But rd_reserved includes blocks that the current process just
    reserved in its own call to inplace_reserve. For example, it can
    reserve the last 128 blocks of an rgrp, then reject that same rgrp
    because the above calculates out to free_blocks = 0;

    Consequences include, but are not limited to, (1) leaving holes,
    and thus increasing file system fragmentation, and (2) reporting
    file system is full long before it actually is.

    This patch introduces a new function, rgd_free, which returns the
    number of clone-free blocks (blocks that are truly free as opposed
    to blocks that are still being used because an unlinked file is
    still open) minus the number of blocks reserved by processes, but
    not counting the blocks we ourselves reserved (because obviously
    we need to allocate them).

    Signed-off-by: Bob Peterson
    Signed-off-by: Andreas Gruenbacher

    Bob Peterson
     
  • Pull in the gfs2 iomap-write changes: Tweak the existing code to
    properly support iomap write and eliminate an unnecessary special case
    in gfs2_block_map. Implement iomap write support for buffered and
    direct I/O. Simplify some of the existing code and eliminate code that
    is no longer used:

    gfs2: Remove gfs2_write_{begin,end}
    gfs2: iomap direct I/O support
    gfs2: gfs2_extent_length cleanup
    gfs2: iomap buffered write support
    gfs2: Further iomap cleanups

    This is based on the following changes on the xfs 'iomap-4.19-merge'
    branch:

    iomap: add private pointer to struct iomap
    iomap: add a page_done callback
    iomap: generic inline data handling
    iomap: complete partial direct I/O writes synchronously
    iomap: mark newly allocated buffer heads as new
    fs: factor out a __generic_write_end helper

    Signed-off-by: Andreas Gruenbacher

    Andreas Gruenbacher
     
  • Before this patch, you could get into situations like this:

    1. Process 1 searches for X free blocks, finds them, makes a reservation
    2. Process 2 searches for free blocks in the same rgrp, but now the
    bitmap is full because process 1's reservation is skipped over.
    So it marks the bitmap as GBF_FULL.
    3. Process 1 tries to allocate blocks from its own reservation, but
    since the GBF_FULL bit is set, it skips over the rgrp and searches
    elsewhere, thus not using its own reservation.

    This patch adds an additional check to allow processes to use their
    own reservations.

    Signed-off-by: Bob Peterson
    Signed-off-by: Andreas Gruenbacher

    Bob Peterson
     

05 Jul, 2018

2 commits

  • GFS2 remembers the last rgrp used for allocations in ip->i_rgd.
    However, block allocations are made by way of a reservations structure,
    ip->i_res, which keeps the last rgrp in ip->i_res.rs_rgd, and ip->i_res
    is kept in sync with ip->i_res.rs_rgd, so it's redundant. Get rid of
    ip->i_rgd and just use ip->i_res.rs_rgd in its place.

    Based on patches by Robert Peterson.

    Signed-off-by: Andreas Gruenbacher
    Signed-off-by: Bob Peterson

    Andreas Gruenbacher
     
  • In the resource group list code, keep the last resource group added in
    the last position in the array. Check against that instead of messing
    with ip->i_rgd.

    Signed-off-by: Andreas Gruenbacher
    Signed-off-by: Bob Peterson

    Andreas Gruenbacher
     

21 Jun, 2018

1 commit

  • Before this patch, block reservations kept track of the inode
    number. At one point, that was a valid thing to do. However, since
    we made the reservation a part of the inode (rather than a pointer
    to a separate allocated object) the reservation can determine the
    inode number by using container_of. This saves us a little memory
    in our inode.

    Signed-off-by: Bob Peterson
    Acked-by: Steven Whitehouse
    Reviewed-by: Andreas Gruenbacher

    Bob Peterson
     

13 Jun, 2018

1 commit

  • The kmalloc() function has a 2-factor argument form, kmalloc_array(). This
    patch replaces cases of:

    kmalloc(a * b, gfp)

    with:
    kmalloc_array(a * b, gfp)

    as well as handling cases of:

    kmalloc(a * b * c, gfp)

    with:

    kmalloc(array3_size(a, b, c), gfp)

    as it's slightly less ugly than:

    kmalloc_array(array_size(a, b), c, gfp)

    This does, however, attempt to ignore constant size factors like:

    kmalloc(4 * 1024, gfp)

    though any constants defined via macros get caught up in the conversion.

    Any factors with a sizeof() of "unsigned char", "char", and "u8" were
    dropped, since they're redundant.

    The tools/ directory was manually excluded, since it has its own
    implementation of kmalloc().

    The Coccinelle script used for this was:

    // Fix redundant parens around sizeof().
    @@
    type TYPE;
    expression THING, E;
    @@

    (
    kmalloc(
    - (sizeof(TYPE)) * E
    + sizeof(TYPE) * E
    , ...)
    |
    kmalloc(
    - (sizeof(THING)) * E
    + sizeof(THING) * E
    , ...)
    )

    // Drop single-byte sizes and redundant parens.
    @@
    expression COUNT;
    typedef u8;
    typedef __u8;
    @@

    (
    kmalloc(
    - sizeof(u8) * (COUNT)
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(__u8) * (COUNT)
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(char) * (COUNT)
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(unsigned char) * (COUNT)
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(u8) * COUNT
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(__u8) * COUNT
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(char) * COUNT
    + COUNT
    , ...)
    |
    kmalloc(
    - sizeof(unsigned char) * COUNT
    + COUNT
    , ...)
    )

    // 2-factor product with sizeof(type/expression) and identifier or constant.
    @@
    type TYPE;
    expression THING;
    identifier COUNT_ID;
    constant COUNT_CONST;
    @@

    (
    - kmalloc
    + kmalloc_array
    (
    - sizeof(TYPE) * (COUNT_ID)
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(TYPE) * COUNT_ID
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(TYPE) * (COUNT_CONST)
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(TYPE) * COUNT_CONST
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(THING) * (COUNT_ID)
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(THING) * COUNT_ID
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(THING) * (COUNT_CONST)
    + COUNT_CONST, sizeof(THING)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(THING) * COUNT_CONST
    + COUNT_CONST, sizeof(THING)
    , ...)
    )

    // 2-factor product, only identifiers.
    @@
    identifier SIZE, COUNT;
    @@

    - kmalloc
    + kmalloc_array
    (
    - SIZE * COUNT
    + COUNT, SIZE
    , ...)

    // 3-factor product with 1 sizeof(type) or sizeof(expression), with
    // redundant parens removed.
    @@
    expression THING;
    identifier STRIDE, COUNT;
    type TYPE;
    @@

    (
    kmalloc(
    - sizeof(TYPE) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kmalloc(
    - sizeof(TYPE) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kmalloc(
    - sizeof(TYPE) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kmalloc(
    - sizeof(TYPE) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kmalloc(
    - sizeof(THING) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kmalloc(
    - sizeof(THING) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kmalloc(
    - sizeof(THING) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kmalloc(
    - sizeof(THING) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    )

    // 3-factor product with 2 sizeof(variable), with redundant parens removed.
    @@
    expression THING1, THING2;
    identifier COUNT;
    type TYPE1, TYPE2;
    @@

    (
    kmalloc(
    - sizeof(TYPE1) * sizeof(TYPE2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kmalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kmalloc(
    - sizeof(THING1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kmalloc(
    - sizeof(THING1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kmalloc(
    - sizeof(TYPE1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    |
    kmalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    )

    // 3-factor product, only identifiers, with redundant parens removed.
    @@
    identifier STRIDE, SIZE, COUNT;
    @@

    (
    kmalloc(
    - (COUNT) * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - COUNT * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - COUNT * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - (COUNT) * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - COUNT * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - (COUNT) * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - (COUNT) * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kmalloc(
    - COUNT * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    )

    // Any remaining multi-factor products, first at least 3-factor products,
    // when they're not all constants...
    @@
    expression E1, E2, E3;
    constant C1, C2, C3;
    @@

    (
    kmalloc(C1 * C2 * C3, ...)
    |
    kmalloc(
    - (E1) * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kmalloc(
    - (E1) * (E2) * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kmalloc(
    - (E1) * (E2) * (E3)
    + array3_size(E1, E2, E3)
    , ...)
    |
    kmalloc(
    - E1 * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    )

    // And then all remaining 2 factors products when they're not all constants,
    // keeping sizeof() as the second factor argument.
    @@
    expression THING, E1, E2;
    type TYPE;
    constant C1, C2, C3;
    @@

    (
    kmalloc(sizeof(THING) * C2, ...)
    |
    kmalloc(sizeof(TYPE) * C2, ...)
    |
    kmalloc(C1 * C2 * C3, ...)
    |
    kmalloc(C1 * C2, ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(TYPE) * (E2)
    + E2, sizeof(TYPE)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(TYPE) * E2
    + E2, sizeof(TYPE)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(THING) * (E2)
    + E2, sizeof(THING)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - sizeof(THING) * E2
    + E2, sizeof(THING)
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - (E1) * E2
    + E1, E2
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - (E1) * (E2)
    + E1, E2
    , ...)
    |
    - kmalloc
    + kmalloc_array
    (
    - E1 * E2
    + E1, E2
    , ...)
    )

    Signed-off-by: Kees Cook

    Kees Cook
     

04 Jun, 2018

1 commit

  • Function gfs2_free_extlen calculates the length of an extent of
    free blocks that may be reserved. The end pointer was calculated as
    end = start + bh->b_size but b_size is incorrect because the
    bitmap usually stops prior to the end of the buffer data on
    the last bitmap.

    What this means is that when you do a write, you can reserve a
    chunk of blocks that runs off the end of the last bitmap. For
    example, I've got a file system where there is only one bitmap
    for each rgrp, so ri_length==1. I saw cases in which iozone
    tried to do a big write, grabbed a large block reservation,
    chose rgrp 5464152, which has ri_data0 5464153 and ri_data 8188.
    So 5464153 + 8188 = 5472341 which is the end of the rgrp.

    When it grabbed a reservation it got back: 5470936, length 7229.
    But 5470936 + 7229 = 5478165. So the reservation starts inside
    the rgrp but runs 5824 blocks past the end of the bitmap.

    This patch fixes the calculation so it won't exceed the last
    bitmap. It also adds a BUG_ON to guard against overflows in the
    future.

    Signed-off-by: Bob Peterson

    Bob Peterson
     

31 Jan, 2018

1 commit


23 Jan, 2018

2 commits

  • 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

    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 future expansion.

    This patch is based on a prototype from Steve Whitehouse.

    Signed-off-by: Bob Peterson
    Signed-off-by: Andreas Gruenbacher

    Bob Peterson
     

19 Jan, 2018

1 commit


17 Jan, 2018

1 commit


13 Dec, 2017

2 commits

  • 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 (or updated with an
    accurate value).

    Signed-off-by: Andrew Price
    Signed-off-by: Bob Peterson

    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 gfs2_rgrpd are set
    using values from the rindex. However, they are needed at this point so
    that userspace can make use of them, allowing a migration away from the
    rindex over time.

    The new fields take up previously reserved space which was explicitly
    zeroed on write so, in clusters with mixed kernels, these fields could
    get zeroed after being set and this should not be treated as an error.

    Signed-off-by: Andrew Price
    Signed-off-by: Bob Peterson

    Andrew Price