linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mateusz Kusiak <mateusz.kusiak@intel.com>
To: linux-raid@vger.kernel.org
Cc: jes@trained-monkey.org, mariusz.tkaczyk@linux.intel.com
Subject: [PATCH v2 3/5] Super-intel: Fix first checkpoint restart
Date: Thu, 18 Jan 2024 11:30:17 +0100	[thread overview]
Message-ID: <20240118103019.12385-4-mateusz.kusiak@intel.com> (raw)
In-Reply-To: <20240118103019.12385-1-mateusz.kusiak@intel.com>

When imsm based array is stopped after reaching first checkpoint and
then assembled, first checkpoint is reported as 0.

This behaviour is valid only for initial checkpoint, if the array was
stopped while performing some action.

Last checkpoint value is not taken from metadata but always starts
with 0 and it's incremented when sync_completed in sysfs changes.

In simplification, read_and_act() is responsible for checkpoint updates
and is executed each time sysfs checkpoint update happens. For first
checkpoint it is executed twice and due to marking checkpoint before
triggering any action on the array, it is impossible to read
sync_completed from sysfs in just two iterations.

The workaround to this is not marking any checkpoint for first
sysfs checkpoint after RAID assembly, to preserve checkpoint value
stored in metadata.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
---
 super-intel.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/super-intel.c b/super-intel.c
index 6a664a2e58d3..ebf43209e75d 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -8741,6 +8741,9 @@ static int imsm_set_array_state(struct active_array *a, int consistent)
 		super->updates_pending++;
 	}
 
+	if (a->prev_action == idle)
+		goto skip_mark_checkpoint;
+
 mark_checkpoint:
 	/* skip checkpointing for general migration,
 	 * it is controlled in mdadm
-- 
2.35.3


  parent reply	other threads:[~2024-01-18 10:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18 10:30 [PATCH v2 0/5] Fix checkpointing - invasive Mateusz Kusiak
2024-01-18 10:30 ` [PATCH v2 1/5] Remove hardcoded checkpoint interval checking Mateusz Kusiak
2024-01-18 10:30 ` [PATCH v2 2/5] monitor: refactor checkpoint update Mateusz Kusiak
2024-01-18 10:30 ` Mateusz Kusiak [this message]
2024-01-18 10:30 ` [PATCH v2 4/5] Grow: Move update_tail assign to Grow_reshape() Mateusz Kusiak
2024-01-18 10:30 ` [PATCH v2 5/5] Add understanding output section in man Mateusz Kusiak
2024-02-20 13:07 ` [PATCH v2 0/5] Fix checkpointing - invasive Mariusz Tkaczyk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240118103019.12385-4-mateusz.kusiak@intel.com \
    --to=mateusz.kusiak@intel.com \
    --cc=jes@trained-monkey.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=mariusz.tkaczyk@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).