From: Yauhen Kharuzhy <yauhen.kharuzhy@zavadatar.com>
To: dsterba@suse.cz, Anand Jain <anand.jain@oracle.com>,
linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: s_bdev is not null after missing replace
Date: Tue, 3 May 2016 23:34:50 +0300 [thread overview]
Message-ID: <20160503203449.GF1110@jeknote.loshitsa1.net> (raw)
In-Reply-To: <20160503173148.GL29353@twin.jikos.cz>
On Tue, May 03, 2016 at 07:31:48PM +0200, David Sterba wrote:
> On Thu, Apr 14, 2016 at 06:24:10PM +0800, Anand Jain wrote:
> > Yauhen reported in the ML that s_bdev is null at mount, and
> > s_bdev gets updated to some device when missing device is
> > replaced, as because bdev is null for missing device, things
> > gets matched up. Fix this by checking if s_bdev is set. I
> > didn't want to completely remove updating s_bdev because
> > the future multi device support at vfs layer may need it.
> >
> > Signed-off-by: Anand Jain <anand.jain@oracle.com>
> > Reported-by: Yauhen Kharuzhy <yauhen.kharuzhy@zavadatar.com>
>
> Do you have a testcase for that? As there are more patches touching the
> device pointers I'd rather see some test coverage. Thanks.
Testcase is ('global spare' patchset is needed for device closing
support):
1) create RAID, mount -> s_bdev is NULL
2) replace latest device by another -> s_bdev is bdev of new drive
3) remove drive added by replace
4) touch mountpount and do btrfs fi sync (device will be closed and
marked as missing here) -> s_bdev is invalid pointer to closed and freed
bdev
5) unmount FS -> oops
Something like:
mkfs.btrfs -d raid5 -m raid5 <dev1> <dev2>... <devN-1>
mount <dev1> /mnt
btrfs replace start -B <devN-1> <devN> /mnt
_devmgt_remove <devN> # _devmgt_remove is helper for detaching scsi device
touch /mnt
btrfs fi sync /mnt
umount /mnt
I will try to make xfstest scripts for this case and for other cases
reported by me.
--
Yauhen Kharuzhy
next prev parent reply other threads:[~2016-05-03 20:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-14 10:24 [PATCH] btrfs: s_bdev is not null after missing replace Anand Jain
2016-05-03 17:31 ` David Sterba
2016-05-03 20:34 ` Yauhen Kharuzhy [this message]
2016-05-03 20:42 ` Yauhen Kharuzhy
2016-05-04 8:14 ` Anand Jain
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=20160503203449.GF1110@jeknote.loshitsa1.net \
--to=yauhen.kharuzhy@zavadatar.com \
--cc=anand.jain@oracle.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
/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).