Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1488220
| Path | csiph.com!1.us.feeder.erje.net!feeder.erje.net!2.eu.feeder.erje.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Shaohua Li <shli@kernel.org> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] raid5: fix to detect failure of register_shrinker |
| Date | Wed, 21 Sep 2016 18:10:01 +0200 |
| Message-ID | <sjSfT-2IV-7@gated-at.bofh.it> (permalink) |
| References | <sjj8t-5vC-7@gated-at.bofh.it> |
| X-Original-To | Chao Yu <yuchao0@huawei.com> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| User-Agent | Mutt/1.5.24 (2015-08-30) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 38 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, chao@kernel.org |
| X-Original-Date | Wed, 21 Sep 2016 09:01:10 -0700 |
| X-Original-Message-ID | <20160921160110.GA30281@kernel.org> |
| X-Original-References | <20160920023357.872-1-yuchao0@huawei.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1488220 |
Show key headers only | View raw
On Tue, Sep 20, 2016 at 10:33:57AM +0800, Chao Yu wrote:
> register_shrinker can fail after commit 1d3d4437eae1 ("vmscan: per-node
> deferred work"), we should detect the failure of it, otherwise we may
> fail to register shrinker after raid5 configuration was setup successfully.
>
> Signed-off-by: Chao Yu <yuchao0@huawei.com>
> ---
> drivers/md/raid5.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index 766c3b7..b819a9a 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -6632,7 +6632,12 @@ static struct r5conf *setup_conf(struct mddev *mddev)
> conf->shrinker.count_objects = raid5_cache_count;
> conf->shrinker.batch = 128;
> conf->shrinker.flags = 0;
> - register_shrinker(&conf->shrinker);
> + if (register_shrinker(&conf->shrinker)) {
> + printk(KERN_ERR
> + "md/raid:%s: couldn't register shrinker.\n",
> + mdname(mddev));
> + goto abort;
> + }
>
> sprintf(pers_name, "raid%d", mddev->new_level);
> conf->thread = md_register_thread(raid5d, mddev, pers_name);
shrinker isn't fatal for raid5. Idealy we can ignore the error and stop
automatically stripe cache increase, but probable it's not worthy the effort.
Applied the patch.
Also the free_conf need better way to check if shrinker register successes. I
add another patch to fix it.
Thanks,
Shaohua
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] raid5: fix to detect failure of register_shrinker Chao Yu <yuchao0@huawei.com> - 2016-09-20 04:40 +0200 Re: [PATCH] raid5: fix to detect failure of register_shrinker Shaohua Li <shli@kernel.org> - 2016-09-21 18:10 +0200
csiph-web