linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: liuzhengyuan <liuzhengyuan@kylinos.cn>
To: shli <shli@fb.com>
Cc: "Song Liu" <songliubraving@fb.com>,
	linux-raid <linux-raid@vger.kernel.org>
Subject: Superblock of raid5 log can't be updated when array stoped
Date: Sat, 15 Oct 2016 10:19:36 +0800	[thread overview]
Message-ID: <tencent_382FBBB34581DF7E1F5EC9A2@qq.com> (raw)

Hi, Shaohua.

when we stop raid5 array with "mdadm -S" or reboot the system,  md module will 
call raid5_quiesce and r5l_quiesce to do some clean work. Some code of r5l_quiesce
was pasted bellow.

                /* make sure r5l_write_super_and_discard_space exits */
                mddev = log->rdev->mddev;
                wake_up(&mddev->sb_wait);
                r5l_wake_reclaim(log, -1L);
                md_unregister_thread(&log->reclaim_thread);
                r5l_do_reclaim(log);
+                md_update_sb(mddev, 1);

It will reclaim all used space of log and call r5l_write_super to reset rdev->journal_tail
to log->next_checkpoint . However, new rdev->journal_tail would not be written to 
journal device for persistent because journal device may not support discard operation
or due to mddev_trylock fail (this trylock should always get failed since raid5_quiesce 
was called with  reconfig_mutex hold, isn't it?). As a result, it will take a long time to
 recovery the log when the arrary was restarted. Should r5l_quiesce call md_update_sb
 directly to guarantee  superblock  update?

             reply	other threads:[~2016-10-15  2:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-15  2:19 liuzhengyuan [this message]
2016-10-18  0:28 ` Superblock of raid5 log can't be updated when array stoped Shaohua Li
2016-10-18  5:51   ` Zhengyuan Liu
2016-10-21 22:43     ` Shaohua Li

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=tencent_382FBBB34581DF7E1F5EC9A2@qq.com \
    --to=liuzhengyuan@kylinos.cn \
    --cc=linux-raid@vger.kernel.org \
    --cc=shli@fb.com \
    --cc=songliubraving@fb.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).