Re: [PATCH 7/8] core.fsync: new option to harden loose references

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 10, 2022 at 1:53 AM Patrick Steinhardt <ps@xxxxxx> wrote:
> diff --git a/Documentation/config/core.txt b/Documentation/config/core.txt
> index 973805e8a9..b67d3c340e 100644
> --- a/Documentation/config/core.txt
> +++ b/Documentation/config/core.txt
> @@ -564,8 +564,10 @@ core.fsync::
>  * `pack-metadata` hardens packfile bitmaps and indexes.
>  * `commit-graph` hardens the commit graph file.
>  * `index` hardens the index when it is modified.
> +* `loose-ref` hardens references modified in the repo in loose-ref form.
>  * `objects` is an aggregate option that is equivalent to
>    `loose-object,pack`.
> +* `refs` is an aggregate option that is equivalent to `loose-ref`.
>  * `derived-metadata` is an aggregate option that is equivalent to
>    `pack-metadata,commit-graph`.
>  * `default` is an aggregate option that is equivalent to
> diff --git a/cache.h b/cache.h
> index 63a95d1977..b56a56f539 100644
> --- a/cache.h
> +++ b/cache.h
> @@ -1005,11 +1005,14 @@ enum fsync_component {
>         FSYNC_COMPONENT_PACK_METADATA           = 1 << 2,
>         FSYNC_COMPONENT_COMMIT_GRAPH            = 1 << 3,
>         FSYNC_COMPONENT_INDEX                   = 1 << 4,
> +       FSYNC_COMPONENT_LOOSE_REF               = 1 << 5,
>  };
>
>  #define FSYNC_COMPONENTS_OBJECTS (FSYNC_COMPONENT_LOOSE_OBJECT | \
>                                   FSYNC_COMPONENT_PACK)
>
> +#define FSYNC_COMPONENTS_REFS (FSYNC_COMPONENT_LOOSE_REF)
> +
>  #define FSYNC_COMPONENTS_DERIVED_METADATA (FSYNC_COMPONENT_PACK_METADATA | \
>                                            FSYNC_COMPONENT_COMMIT_GRAPH)
>
> @@ -1026,7 +1029,8 @@ enum fsync_component {
>                               FSYNC_COMPONENT_PACK | \
>                               FSYNC_COMPONENT_PACK_METADATA | \
>                               FSYNC_COMPONENT_COMMIT_GRAPH | \
> -                             FSYNC_COMPONENT_INDEX)
> +                             FSYNC_COMPONENT_INDEX | \
> +                             FSYNC_COMPONENT_LOOSE_REF)
>
>  /*
>   * A bitmask indicating which components of the repo should be fsynced.
> diff --git a/config.c b/config.c
> index f03f27c3de..b5d3e6e404 100644
> --- a/config.c
> +++ b/config.c
> @@ -1332,7 +1332,9 @@ static const struct fsync_component_entry {
>         { "pack-metadata", FSYNC_COMPONENT_PACK_METADATA },
>         { "commit-graph", FSYNC_COMPONENT_COMMIT_GRAPH },
>         { "index", FSYNC_COMPONENT_INDEX },
> +       { "loose-ref", FSYNC_COMPONENT_LOOSE_REF },
>         { "objects", FSYNC_COMPONENTS_OBJECTS },
> +       { "refs", FSYNC_COMPONENTS_REFS },
>         { "derived-metadata", FSYNC_COMPONENTS_DERIVED_METADATA },
>         { "default", FSYNC_COMPONENTS_DEFAULT },
>         { "committed", FSYNC_COMPONENTS_COMMITTED },

In terms of the 'preciousness-levels', refs should be included in
FSYNC_COMPONENTS_COMMITTED,
from which it will also be included in _ADDED.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux