linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] md/raid5-cache: no recovery is required when create super-block
@ 2016-12-06  6:13 JackieLiu
  2016-12-07 17:26 ` Shaohua Li
  0 siblings, 1 reply; 4+ messages in thread
From: JackieLiu @ 2016-12-06  6:13 UTC (permalink / raw)
  To: songliubraving; +Cc: liuzhengyuan, shli, linux-raid, JackieLiu

When create the super-block information, We do not need to do this
recovery stage, only need to initialize some variables.
---
 drivers/md/raid5-cache.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c
index c3b3124..96f25df 100644
--- a/drivers/md/raid5-cache.c
+++ b/drivers/md/raid5-cache.c
@@ -2545,7 +2545,13 @@ static int r5l_load_log(struct r5l_log *log)
 
 	__free_page(page);
 
-	ret = r5l_recovery_log(log);
+	if (create_super) {
+		log->log_start = r5l_ring_add(log, cp, BLOCK_SECTORS);
+		log->seq = log->last_cp_seq + 1;
+		log->next_checkpoint = cp;
+	} else
+		ret = r5l_recovery_log(log);
+
 	r5c_update_log_state(log);
 	return ret;
 ioerr:
-- 
2.10.2




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

* Re: [PATCH] md/raid5-cache: no recovery is required when create super-block
  2016-12-06  6:13 [PATCH] md/raid5-cache: no recovery is required when create super-block JackieLiu
@ 2016-12-07 17:26 ` Shaohua Li
  0 siblings, 0 replies; 4+ messages in thread
From: Shaohua Li @ 2016-12-07 17:26 UTC (permalink / raw)
  To: JackieLiu; +Cc: songliubraving, liuzhengyuan, shli, linux-raid

On Tue, Dec 06, 2016 at 02:13:17PM +0800, JackieLiu wrote:
> When create the super-block information, We do not need to do this
> recovery stage, only need to initialize some variables.

This makes sense.

please do look at Documentation/SubmittingPatches. I can't apply patch without
'signed-off-by'.

> ---
>  drivers/md/raid5-cache.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c
> index c3b3124..96f25df 100644
> --- a/drivers/md/raid5-cache.c
> +++ b/drivers/md/raid5-cache.c
> @@ -2545,7 +2545,13 @@ static int r5l_load_log(struct r5l_log *log)
>  
>  	__free_page(page);
>  
> -	ret = r5l_recovery_log(log);
> +	if (create_super) {
> +		log->log_start = r5l_ring_add(log, cp, BLOCK_SECTORS);
> +		log->seq = log->last_cp_seq + 1;
> +		log->next_checkpoint = cp;

must set ret = 0 here. Next time please make sure there isn't compiling
warnning.

Thanks,
Shaohua

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

* [PATCH] md/raid5-cache: no recovery is required when create super-block
@ 2016-12-08  0:47 JackieLiu
  2016-12-08 18:00 ` Shaohua Li
  0 siblings, 1 reply; 4+ messages in thread
From: JackieLiu @ 2016-12-08  0:47 UTC (permalink / raw)
  To: shli; +Cc: songliubraving, liuzhengyuan, linux-raid, JackieLiu

When create the super-block information, We do not need to do this
recovery stage, only need to initialize some variables.

Signed-off-by: JackieLiu <liuyun01@kylinos.cn>
---
 drivers/md/raid5-cache.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c
index c3b3124..7c732c5 100644
--- a/drivers/md/raid5-cache.c
+++ b/drivers/md/raid5-cache.c
@@ -2492,7 +2492,7 @@ static int r5l_load_log(struct r5l_log *log)
 	sector_t cp = log->rdev->journal_tail;
 	u32 stored_crc, expected_crc;
 	bool create_super = false;
-	int ret;
+	int ret = 0;
 
 	/* Make sure it's valid */
 	if (cp >= rdev->sectors || round_down(cp, BLOCK_SECTORS) != cp)
@@ -2545,7 +2545,13 @@ static int r5l_load_log(struct r5l_log *log)
 
 	__free_page(page);
 
-	ret = r5l_recovery_log(log);
+	if (create_super) {
+		log->log_start = r5l_ring_add(log, cp, BLOCK_SECTORS);
+		log->seq = log->last_cp_seq + 1;
+		log->next_checkpoint = cp;
+	} else
+		ret = r5l_recovery_log(log);
+
 	r5c_update_log_state(log);
 	return ret;
 ioerr:
-- 
2.10.2




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

* Re: [PATCH] md/raid5-cache: no recovery is required when create super-block
  2016-12-08  0:47 JackieLiu
@ 2016-12-08 18:00 ` Shaohua Li
  0 siblings, 0 replies; 4+ messages in thread
From: Shaohua Li @ 2016-12-08 18:00 UTC (permalink / raw)
  To: JackieLiu; +Cc: shli, songliubraving, liuzhengyuan, linux-raid

On Thu, Dec 08, 2016 at 08:47:39AM +0800, JackieLiu wrote:
> When create the super-block information, We do not need to do this
> recovery stage, only need to initialize some variables.

applied, thanks!
 
> Signed-off-by: JackieLiu <liuyun01@kylinos.cn>
> ---
>  drivers/md/raid5-cache.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c
> index c3b3124..7c732c5 100644
> --- a/drivers/md/raid5-cache.c
> +++ b/drivers/md/raid5-cache.c
> @@ -2492,7 +2492,7 @@ static int r5l_load_log(struct r5l_log *log)
>  	sector_t cp = log->rdev->journal_tail;
>  	u32 stored_crc, expected_crc;
>  	bool create_super = false;
> -	int ret;
> +	int ret = 0;
>  
>  	/* Make sure it's valid */
>  	if (cp >= rdev->sectors || round_down(cp, BLOCK_SECTORS) != cp)
> @@ -2545,7 +2545,13 @@ static int r5l_load_log(struct r5l_log *log)
>  
>  	__free_page(page);
>  
> -	ret = r5l_recovery_log(log);
> +	if (create_super) {
> +		log->log_start = r5l_ring_add(log, cp, BLOCK_SECTORS);
> +		log->seq = log->last_cp_seq + 1;
> +		log->next_checkpoint = cp;
> +	} else
> +		ret = r5l_recovery_log(log);
> +
>  	r5c_update_log_state(log);
>  	return ret;
>  ioerr:
> -- 
> 2.10.2
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2016-12-08 18:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-06  6:13 [PATCH] md/raid5-cache: no recovery is required when create super-block JackieLiu
2016-12-07 17:26 ` Shaohua Li
  -- strict thread matches above, loose matches on Subject: below --
2016-12-08  0:47 JackieLiu
2016-12-08 18:00 ` Shaohua Li

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).