From: Neil Brown <neilb@suse.de>
To: Shaohua Li <shli@fb.com>
Cc: linux-raid@vger.kernel.org, Kernel-team@fb.com,
songliubraving@fb.com, hch@infradead.org,
dan.j.williams@intel.com
Subject: Re: [PATCH 4/6] md: don't export log device
Date: Thu, 08 Oct 2015 17:04:54 +1100 [thread overview]
Message-ID: <8737xl7v5l.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <20151008043121.GA3189627@devbig084.prn1.facebook.com>
[-- Attachment #1: Type: text/plain, Size: 2246 bytes --]
Shaohua Li <shli@fb.com> writes:
> On Thu, Oct 08, 2015 at 03:16:41PM +1100, Neil Brown wrote:
>> Shaohua Li <shli@fb.com> writes:
>> >>
>> >> Neither of these chunks should be needed.
>> >> ->raid_disk of an active devices is only set to -1 if ->hot_remove_disk
>> >> succeeds.
>> >> You have make ->hot_remove_disk fail for Journal devices, so ->raid_disk
>> >> will be >= 0.
>> >
>> > I agree the raid5_remove_disk part is superficial, I fixed in an updated
>> > patch. I still didn't get the point what can prevent a journal disk is
>> > removed. Currently the raid_disk is always -1 for journal disk. If it
>> > should be >=0, what value it should be? We give journal disk a special
>> > role '0xfffd' currently.
>>
>> Oh, are we leaving the ->raid_disk at -1 for the journal? I hadn't
>> noticed that. I don't feel comfortable it. Too much code assumes that
>> <0 means "not in use".
>>
>> Probably set it to 0, and add a check to setup_conf(), and adjust the
>> check in run(). md_update_sb() probably need to be careful of journals
>> too (to not change ->recovery_offset).
>> I wonder what 'slot_show' should report for the journal.... maybe
>> "journal"??
>
> ->raid_disk >= 0 is for normal raid disks. If we use it, we will have
> two disks with ->raid_disk 0, it sounds weird. Currently we add the
> 'test(Journal, rdev->flags)' check in different places to destinguish
> journal disk. We will need to audit the code which assumes ' < 0 means
> not in use'. We will probably need to audit the same code if we set
> ->raid_disk 0 for journal. Neither is perfect.
Having two disks with ->raid_disk==0 does seem a little weird, but we do
already have that in some cases.
When you have a hot-replace going, both the original and the replacement
have the same ->raid_disk numbers. They can be distinguished by the
Replacement flag.
I'm suggesting the same (sort of) for journals, and distinguish by the
Journal flag.
I did quick audit and just found setup_conf, run() and md_update_sb().
If you could do an audit to that would be good. I'd be surprised if you
find many more places where Journal needs to be tested with ->raid_disk.
Thanks,
NeilBrown
>
> Thanks,
> Shaohua
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
next prev parent reply other threads:[~2015-10-08 6:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-04 16:20 [PATCH 0/6] raid5-cache fixes Shaohua Li
2015-10-04 16:20 ` [PATCH 1/6] md: show journal for journal disk in disk state sysfs Shaohua Li
2015-10-04 16:20 ` [PATCH 2/6] raid5-cache: move reclaim stop to quiesce Shaohua Li
2015-10-04 16:20 ` [PATCH 3/6] raid5-cache: add trim support for log Shaohua Li
2015-10-08 1:53 ` Neil Brown
2015-10-04 16:20 ` [PATCH 4/6] md: don't export log device Shaohua Li
2015-10-08 1:57 ` Neil Brown
2015-10-08 3:16 ` Shaohua Li
2015-10-08 4:16 ` Neil Brown
2015-10-08 4:31 ` Shaohua Li
2015-10-08 6:04 ` Neil Brown [this message]
2015-10-13 12:07 ` Christoph Hellwig
2015-10-13 20:41 ` Neil Brown
2015-10-04 16:20 ` [PATCH 5/6] md: set In_Sync for log disk Shaohua Li
2015-10-04 16:20 ` [PATCH 6/6] raid5-cache: IO error handling Shaohua Li
2015-10-08 2:10 ` [PATCH 0/6] raid5-cache fixes Neil Brown
2015-10-08 2:56 ` Shaohua Li
2015-10-08 3:18 ` Neil Brown
2015-10-08 3:24 ` 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=8737xl7v5l.fsf@notabene.neil.brown.name \
--to=neilb@suse.de \
--cc=Kernel-team@fb.com \
--cc=dan.j.williams@intel.com \
--cc=hch@infradead.org \
--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).