git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] refs/reftable: add fsck checks
@ 2025-08-19 12:20 Karthik Nayak
  2025-08-19 12:21 ` [PATCH 1/5] fsck: order 'fsck_msg_type' alphabetically Karthik Nayak
                   ` (10 more replies)
  0 siblings, 11 replies; 96+ messages in thread
From: Karthik Nayak @ 2025-08-19 12:20 UTC (permalink / raw)
  To: git; +Cc: Karthik Nayak

This series adds the required infrastructure and also some fsck checks
for the reftable backend.

Since the reftable backend is treated as a library within the Git
codebase, we don't want to spillover our internal fsck implementation
into the library. At the same time, the fsck checks need to access
internal structures of the reftable library which aren't exposed outside
the library.

So we solve this by adding a 'reftable/fsck.[ch]' which implements and
exposes a checker for the reftable library and returns specific errors
as defined by the library. We then add glue code within
'refs/reftable-backend.c' to map these errors to errors which Git's fsck
implementation would understand. This allows us to separate concerns.

This series then adds some checks on the stack ('reftable/tables.list')
level of reftable, namely:
1. The table name is as per the spec
2. The number of tables are consistent
3. The tables.list has a newline at the end of file
4. The table names follow correct index sequences

I also plan to send in follow up series's which will implement further
checks and go into deeper layers (tables, block, references).

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
---
 Documentation/fsck-msgids.adoc |  15 +++-
 Makefile                       |   1 +
 fsck.h                         | 154 +++++++++++++++++++++--------------------
 meson.build                    |   1 +
 refs/reftable-backend.c        |  70 +++++++++++++++++--
 reftable/fsck.c                | 132 +++++++++++++++++++++++++++++++++++
 reftable/reftable-fsck.h       |  44 ++++++++++++
 t/meson.build                  |   3 +-
 t/t0614-reftable-fsck.sh       | 138 ++++++++++++++++++++++++++++++++++++
 9 files changed, 473 insertions(+), 85 deletions(-)

Karthik Nayak (5):
      fsck: order 'fsck_msg_type' alphabetically
      refs/reftable: add fsck check for checking the table name
      refs/reftable: add fsck check for number of tables
      refs/reftable: add fsck check for trailing newline
      refs/reftable: add fsck check for incorrect update index



base-commit: c44beea485f0f2feaf460e2ac87fdd5608d63cf0
change-id: 20250714-228-reftable-introduce-consistency-checks-379ded93c544

Thanks
- Karthik


^ permalink raw reply	[flat|nested] 96+ messages in thread

end of thread, other threads:[~2025-10-07 16:25 UTC | newest]

Thread overview: 96+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-19 12:20 [PATCH 0/5] refs/reftable: add fsck checks Karthik Nayak
2025-08-19 12:21 ` [PATCH 1/5] fsck: order 'fsck_msg_type' alphabetically Karthik Nayak
2025-08-19 12:21 ` [PATCH 2/5] refs/reftable: add fsck check for checking the table name Karthik Nayak
2025-08-26 16:21   ` shejialuo
2025-09-01 13:33     ` Karthik Nayak
2025-09-03 13:39       ` shejialuo
2025-08-19 12:21 ` [PATCH 3/5] refs/reftable: add fsck check for number of tables Karthik Nayak
2025-08-26 16:33   ` shejialuo
2025-09-01 13:40     ` Karthik Nayak
2025-08-26 16:44   ` shejialuo
2025-09-01 13:52     ` Karthik Nayak
2025-08-19 12:21 ` [PATCH 4/5] refs/reftable: add fsck check for trailing newline Karthik Nayak
2025-08-19 12:21 ` [PATCH 5/5] refs/reftable: add fsck check for incorrect update index Karthik Nayak
2025-08-26 16:39 ` [PATCH 0/5] refs/reftable: add fsck checks shejialuo
2025-09-01 13:52   ` Karthik Nayak
2025-09-02  7:05 ` [PATCH v2 " Karthik Nayak
2025-09-02  7:05   ` [PATCH v2 1/5] fsck: order 'fsck_msg_type' alphabetically Karthik Nayak
2025-09-02 22:25     ` Junio C Hamano
2025-09-08 13:00       ` Karthik Nayak
2025-09-02  7:05   ` [PATCH v2 2/5] refs/reftable: add fsck check for checking the table name Karthik Nayak
2025-09-03  8:07     ` Patrick Steinhardt
2025-09-03 16:51       ` shejialuo
2025-09-09 13:49         ` Karthik Nayak
2025-09-09  8:42       ` Karthik Nayak
2025-09-02  7:05   ` [PATCH v2 3/5] refs/reftable: add fsck check for number of tables Karthik Nayak
2025-09-03  8:07     ` Patrick Steinhardt
2025-09-15  9:27       ` Karthik Nayak
2025-09-02  7:05   ` [PATCH v2 4/5] refs/reftable: add fsck check for trailing newline Karthik Nayak
2025-09-02 22:38     ` Junio C Hamano
2025-09-03  8:07       ` Patrick Steinhardt
2025-09-02  7:05   ` [PATCH v2 5/5] refs/reftable: add fsck check for incorrect update index Karthik Nayak
2025-09-02 22:42     ` Junio C Hamano
2025-09-18  8:11       ` Karthik Nayak
2025-09-18  8:11 ` [PATCH v3 0/8] refs/reftable: add consistency checks Karthik Nayak
2025-09-18  8:11   ` [PATCH v3 1/8] refs: remove unused headers Karthik Nayak
2025-09-18  8:11   ` [PATCH v3 2/8] refs: move consistency check msg to generic layer Karthik Nayak
2025-09-18  8:11   ` [PATCH v3 3/8] reftable: check for trailing newline in 'tables.list' Karthik Nayak
2025-09-18 15:36     ` Junio C Hamano
2025-09-23 15:42       ` Karthik Nayak
2025-09-24  5:54     ` Patrick Steinhardt
2025-09-24 10:02       ` Karthik Nayak
2025-09-24  7:24     ` Kristoffer Haugsbakk
2025-09-24 11:06       ` Karthik Nayak
2025-09-18  8:11   ` [PATCH v3 4/8] reftable: ensure tables in a stack use sequential update indices Karthik Nayak
2025-09-24  5:54     ` Patrick Steinhardt
2025-09-24 11:20       ` Karthik Nayak
2025-09-24 18:04         ` Junio C Hamano
2025-09-24 20:13           ` Karthik Nayak
2025-09-25  6:12             ` Patrick Steinhardt
2025-09-25 16:22               ` Junio C Hamano
2025-09-18  8:11   ` [PATCH v3 5/8] Documentation/fsck-msgids: remove duplicate msg id Karthik Nayak
2025-09-18  8:11   ` [PATCH v3 6/8] fsck: order 'fsck_msg_type' alphabetically Karthik Nayak
2025-09-18  8:11   ` [PATCH v3 7/8] reftable: add code to facilitate consistency checks Karthik Nayak
2025-09-24  5:54     ` Patrick Steinhardt
2025-09-24 18:40       ` Karthik Nayak
2025-09-25  6:14         ` Patrick Steinhardt
2025-09-18  8:11   ` [PATCH v3 8/8] refs/reftable: add fsck check for checking the table name Karthik Nayak
2025-09-24  5:54     ` Patrick Steinhardt
2025-09-24 18:44       ` Karthik Nayak
2025-09-26  7:25 ` [PATCH v4 0/7] refs/reftable: add consistency checks Karthik Nayak
2025-09-26  7:25   ` [PATCH v4 1/7] refs: remove unused headers Karthik Nayak
2025-09-26  7:25   ` [PATCH v4 2/7] refs: move consistency check msg to generic layer Karthik Nayak
2025-09-26  7:25   ` [PATCH v4 3/7] reftable: check for trailing newline in 'tables.list' Karthik Nayak
2025-10-02 11:44     ` Patrick Steinhardt
2025-10-06 12:02       ` Karthik Nayak
2025-09-26  7:25   ` [PATCH v4 4/7] Documentation/fsck-msgids: remove duplicate msg id Karthik Nayak
2025-09-26  7:25   ` [PATCH v4 5/7] fsck: order 'fsck_msg_type' alphabetically Karthik Nayak
2025-09-26  7:25   ` [PATCH v4 6/7] reftable: add code to facilitate consistency checks Karthik Nayak
2025-10-02 11:44     ` Patrick Steinhardt
2025-09-26  7:25   ` [PATCH v4 7/7] refs/reftable: add fsck check for checking the table name Karthik Nayak
2025-10-02 11:44     ` Patrick Steinhardt
2025-10-06 12:05       ` Karthik Nayak
2025-09-26 21:08   ` [PATCH v4 0/7] refs/reftable: add consistency checks Junio C Hamano
2025-10-06 14:22 ` [PATCH v5 " Karthik Nayak
2025-10-06 14:22   ` [PATCH v5 1/7] refs: remove unused headers Karthik Nayak
2025-10-06 14:23   ` [PATCH v5 2/7] refs: move consistency check msg to generic layer Karthik Nayak
2025-10-06 14:23   ` [PATCH v5 3/7] reftable: check for trailing newline in 'tables.list' Karthik Nayak
2025-10-06 14:23   ` [PATCH v5 4/7] Documentation/fsck-msgids: remove duplicate msg id Karthik Nayak
2025-10-06 14:23   ` [PATCH v5 5/7] fsck: order 'fsck_msg_type' alphabetically Karthik Nayak
2025-10-06 14:23   ` [PATCH v5 6/7] reftable: add code to facilitate consistency checks Karthik Nayak
2025-10-06 14:23   ` [PATCH v5 7/7] refs/reftable: add fsck check for checking the table name Karthik Nayak
2025-10-07  2:32     ` Jeff King
2025-10-07  8:45       ` Karthik Nayak
2025-10-06 22:08   ` [PATCH v5 0/7] refs/reftable: add consistency checks Junio C Hamano
2025-10-07  8:47     ` Karthik Nayak
2025-10-07 15:11       ` Junio C Hamano
2025-10-07 12:11 ` [PATCH v6 " Karthik Nayak
2025-10-07 12:11   ` [PATCH v6 1/7] refs: remove unused headers Karthik Nayak
2025-10-07 12:11   ` [PATCH v6 2/7] refs: move consistency check msg to generic layer Karthik Nayak
2025-10-07 12:11   ` [PATCH v6 3/7] reftable: check for trailing newline in 'tables.list' Karthik Nayak
2025-10-07 12:11   ` [PATCH v6 4/7] Documentation/fsck-msgids: remove duplicate msg id Karthik Nayak
2025-10-07 12:11   ` [PATCH v6 5/7] fsck: order 'fsck_msg_type' alphabetically Karthik Nayak
2025-10-07 12:11   ` [PATCH v6 6/7] reftable: add code to facilitate consistency checks Karthik Nayak
2025-10-07 12:11   ` [PATCH v6 7/7] refs/reftable: add fsck check for checking the table name Karthik Nayak
2025-10-07 13:26   ` [PATCH v6 0/7] refs/reftable: add consistency checks Patrick Steinhardt
2025-10-07 16:25     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).