Skip to contentSkip to conversation

Kernel oops adding bitmap

DISCUSSION Larkin Lowrey 4 participants 7 messages Mar 19, 2012 – Mar 22, 2012 MD RAID

lore
Share & tools
lore
#0 lore raw

The following command oopsed.

mdadm -G --bitmap=internal /dev/md0

The array is a two disk raid1 and hosts the root filesystem.

Is it not possible/allowed to add a bitmap to an active/mounted array?

[  339.521575] scsi_verify_blk_ioctl: 662 callbacks suppressed
[  339.531128] mdadm: sending ioctl 1261 to a partition!
[  339.539999] mdadm: sending ioctl 1261 to a partition!
[  339.549504] mdadm: sending ioctl 1261 to a partition!
[  339.558273] mdadm: sending ioctl 1261 to a partition!
[  339.570764] md0: bitmap file is out of date (0 < 47) -- forcing full
recovery
[  339.574628] mdadm: sending ioctl 800c0910 to a partition!
[  339.574635] mdadm: sending ioctl 800c0910 to a partition!
[  339.574646] mdadm: sending ioctl 1261 to a partition!
[  339.574650] mdadm: sending ioctl 1261 to a partition!
[  339.580825] mdadm: sending ioctl 800c0910 to a partition!
[  339.580832] mdadm: sending ioctl 800c0910 to a partition!
[  339.634433] created bitmap (1 pages) for device md0
[  341.719752] BUG: unable to handle kernel NULL pointer dereference at
0000000000000010
[  341.720673] IP: [<ffffffff81473cc0>] bitmap_endwrite+0x130/0x250
[  341.720673] PGD 0
[  341.720673] Oops: 0000 [#1] SMP
[  341.720673] CPU 1
[  341.720673] Modules linked in: lockd it87 hwmon_vid ip6t_REJECT

nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter nf_conntrack_ipv4 nf_defrag_ipv4 xt_state ip6_tables nf_conntrack keyspan snd_hda_codec_hdmi snd_hda_intel snd_hda_codec snd_hwdep snd_seq snd_seq_device microcode edac_core sp5100_tco snd_pcm edac_mce_amd i2c_piix4 r8169 k10temp mii serio_raw snd_timer snd soundcore snd_page_alloc shpchp uinput sunrpc raid456 async_raid6_recov async_pq raid6_pq async_xor xor async_memcpy async_tx pata_acpi ata_generic raid0 raid1 firewire_ohci firewire_core crc_itu_t pata_atiixp mvsas libsas scsi_transport_sas wmi radeon ttm drm_kms_helper drm i2c_algo_bit i2c_core [last unloaded: scsi_wait_scan]

[  341.720673]
[  341.720673] Pid: 0, comm: swapper/1 Not tainted 3.2.9-1.fc16.x86_64
#1 Gigabyte Technology Co., Ltd. GA-MA790GPT-UD3H/GA-MA790GPT-UD3H
[  341.720673] RIP: 0010:[<ffffffff81473cc0>]  [<ffffffff81473cc0>]
bitmap_endwrite+0x130/0x250
[  341.867091] RSP: 0018:ffff880227c43b90  EFLAGS: 00010046
[  341.867091] RAX: 0000000000000000 RBX: ffff8802110edd00 RCX:
0000000000000000
[  341.867091] RDX: 00000000000000a4 RSI: 00000000000008a4 RDI:
0000000000000000
[  341.867091] RBP: ffff880227c43bf0 R08: 0000000000000000 R09:
000000000000000b
[  341.867091] R10: 0000000000000000 R11: 0000000000000001 R12:
0000000001485d40
[  341.867091] R13: ffff8802110edd3c R14: 0000000000000202 R15:
0000000000000008
[  341.867091] FS:  00007fa3e76bd7c0(0000) GS:ffff880227c40000(0000)

knlGS:0000000000000000

This is all I got over the serial console.

--Larkin

#1 lore raw
Quoted 7 lines · On Mon, 19 Mar 2012 11:44:45 -0500 Larkin Lowrey <[email protected]>…

The following command oopsed.

mdadm -G --bitmap=internal /dev/md0

The array is a two disk raid1 and hosts the root filesystem.

Is it not possible/allowed to add a bitmap to an active/mounted array?

It is. But it is busted.

Either use an older mdadm (3.2.2 or earlier), or apply this patch

http://neil.brown.name/git?p=md;a=commitdiff;h=4474ca42e2577563a919fd3ed782e2ec55bf11a2

which has been sent to Linus already and should appear in -stable kernels in a couple of weeks.

NeilBrown

drivers/md/bitmap.c +2 -0
index cdf36b1..239af9a 100644
@@ -1904,6 +1904,8 @@ location_store(struct mddev *mddev, const char *buf, size_t len)
 			if (mddev->pers) {
 				mddev->pers->quiesce(mddev, 1);
 				rv = bitmap_create(mddev);
+				if (!rv)
+					rv = bitmap_load(mddev);
 				if (rv) {
 					bitmap_destroy(mddev);
 					mddev->bitmap_info.offset = 0;
Quoted 57 lines
[  339.521575] scsi_verify_blk_ioctl: 662 callbacks suppressed
[  339.531128] mdadm: sending ioctl 1261 to a partition!
[  339.539999] mdadm: sending ioctl 1261 to a partition!
[  339.549504] mdadm: sending ioctl 1261 to a partition!
[  339.558273] mdadm: sending ioctl 1261 to a partition!
[  339.570764] md0: bitmap file is out of date (0 < 47) -- forcing full
recovery
[  339.574628] mdadm: sending ioctl 800c0910 to a partition!
[  339.574635] mdadm: sending ioctl 800c0910 to a partition!
[  339.574646] mdadm: sending ioctl 1261 to a partition!
[  339.574650] mdadm: sending ioctl 1261 to a partition!
[  339.580825] mdadm: sending ioctl 800c0910 to a partition!
[  339.580832] mdadm: sending ioctl 800c0910 to a partition!
[  339.634433] created bitmap (1 pages) for device md0
[  341.719752] BUG: unable to handle kernel NULL pointer dereference at
0000000000000010
[  341.720673] IP: [<ffffffff81473cc0>] bitmap_endwrite+0x130/0x250
[  341.720673] PGD 0
[  341.720673] Oops: 0000 [#1] SMP
[  341.720673] CPU 1
[  341.720673] Modules linked in: lockd it87 hwmon_vid ip6t_REJECT

nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter nf_conntrack_ipv4 nf_defrag_ipv4 xt_state ip6_tables nf_conntrack keyspan snd_hda_codec_hdmi snd_hda_intel snd_hda_codec snd_hwdep snd_seq snd_seq_device microcode edac_core sp5100_tco snd_pcm edac_mce_amd i2c_piix4 r8169 k10temp mii serio_raw snd_timer snd soundcore snd_page_alloc shpchp uinput sunrpc raid456 async_raid6_recov async_pq raid6_pq async_xor xor async_memcpy async_tx pata_acpi ata_generic raid0 raid1 firewire_ohci firewire_core crc_itu_t pata_atiixp mvsas libsas scsi_transport_sas wmi radeon ttm drm_kms_helper drm i2c_algo_bit i2c_core [last unloaded: scsi_wait_scan]

[  341.720673]
[  341.720673] Pid: 0, comm: swapper/1 Not tainted 3.2.9-1.fc16.x86_64
#1 Gigabyte Technology Co., Ltd. GA-MA790GPT-UD3H/GA-MA790GPT-UD3H
[  341.720673] RIP: 0010:[<ffffffff81473cc0>]  [<ffffffff81473cc0>]
bitmap_endwrite+0x130/0x250
[  341.867091] RSP: 0018:ffff880227c43b90  EFLAGS: 00010046
[  341.867091] RAX: 0000000000000000 RBX: ffff8802110edd00 RCX:
0000000000000000
[  341.867091] RDX: 00000000000000a4 RSI: 00000000000008a4 RDI:
0000000000000000
[  341.867091] RBP: ffff880227c43bf0 R08: 0000000000000000 R09:
000000000000000b
[  341.867091] R10: 0000000000000000 R11: 0000000000000001 R12:
0000000001485d40
[  341.867091] R13: ffff8802110edd3c R14: 0000000000000202 R15:
0000000000000008
[  341.867091] FS:  00007fa3e76bd7c0(0000) GS:ffff880227c40000(0000)

knlGS:0000000000000000

This is all I got over the serial console.

--Larkin
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 1 line · NeilBrown

On Mon, 19 Mar 2012 11:44:45 -0500 Larkin Lowrey

<[email protected]>

Quoted 10 lines
Quoted 7 lines · wrote:

The following command oopsed.

mdadm -G --bitmap=internal /dev/md0

The array is a two disk raid1 and hosts the root filesystem.

Is it not possible/allowed to add a bitmap to an active/mounted array?

Quoted 7 lines

It is. But it is busted.

Either use an older mdadm (3.2.2 or earlier), or apply this patch

http://neil.brown.name/git?p=md;a=commitdiff;h=4474ca42e2577563a919fd3ed782e2ec55bf11a2

which has been sent to Linus already and should appear in -stable

kernels in

Quoted 3 lines

a couple of weeks.

NeilBrown

Thank you for the explanation.

--Larkin

#3 lore raw

Btw, was interested in, where bitmap will be placed when adding it on live array? I.e. as it requires some diskspace, we should provide some free space, but where it can be taken from if array is already created and used by, say filesystem?

Quoted 33 lines · Larkin Lowrey
Quoted 1 line · NeilBrown

On Mon, 19 Mar 2012 11:44:45 -0500 Larkin Lowrey

<[email protected]>

Quoted 10 lines
Quoted 7 lines · wrote:

The following command oopsed.

mdadm -G --bitmap=internal /dev/md0

The array is a two disk raid1 and hosts the root filesystem.

Is it not possible/allowed to add a bitmap to an active/mounted array?

Quoted 7 lines

It is. But it is busted.

Either use an older mdadm (3.2.2 or earlier), or apply this patch

http://neil.brown.name/git?p=md;a=commitdiff;h=4474ca42e2577563a919fd3ed782e2ec55bf11a2

which has been sent to Linus already and should appear in -stable

kernels in

Quoted 3 lines

a couple of weeks.

NeilBrown

Thank you for the explanation.

--Larkin

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Signature · 6 lines
Best regards,
[COOLCOLD-RIPN]
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw
Quoted 4 lines · CoolCold

Btw, was interested in, where bitmap will be placed when adding it on live array? I.e. as it requires some diskspace, we should provide some free space, but where it can be taken from if array is already created and used by, say filesystem?

There's room allocated in the metadata for it at create time, whether or not it's used from create time, ever since bitmaps were introduced. Before mdadm 3.1.2, total metadata size depended on the array size, because the bitmap size depended on the array size, but from 3.1.2 on mdadm allocates 1MB for metadata including the bitmap (which is much more than is really needed but helps keep things 1MB-aligned).

Cheers,

John.

#5 lore raw
In reply to CoolCold
Quoted 4 lines · On Wed, 21 Mar 2012 17:21:55 +0400 CoolCold <[email protected]> wrote:

Btw, was interested in, where bitmap will be placed when adding it on live array? I.e. as it requires some diskspace, we should provide some free space, but where it can be taken from if array is already created and used by, say filesystem?

For 0.90 metadata there is 60K of unused space after the superblock. The bitmap is stored there.

For 1.x, the metadata stores a data_offset and data_size. All array data is in that range. Anything out side there is available for mdadm to use. When mdadm creates an array it reserves enough space for bitmap and possible other uses.

NeilBrown

Quoted 39 lines
Quoted 33 lines · Larkin Lowrey
Quoted 1 line · NeilBrown

On Mon, 19 Mar 2012 11:44:45 -0500 Larkin Lowrey

<[email protected]>

Quoted 10 lines
Quoted 7 lines · wrote:

The following command oopsed.

mdadm -G --bitmap=internal /dev/md0

The array is a two disk raid1 and hosts the root filesystem.

Is it not possible/allowed to add a bitmap to an active/mounted array?

Quoted 7 lines

It is. But it is busted.

Either use an older mdadm (3.2.2 or earlier), or apply this patch

http://neil.brown.name/git?p=md;a=commitdiff;h=4474ca42e2577563a919fd3ed782e2ec55bf11a2

which has been sent to Linus already and should appear in -stable

kernels in

Quoted 3 lines

a couple of weeks.

NeilBrown

Thank you for the explanation.

--Larkin

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

#6 lore raw
Quoted 10 lines · NeilBrown
Quoted 4 lines · On Wed, 21 Mar 2012 17:21:55 +0400 CoolCold <[email protected]> wrote:

Btw, was interested in, where bitmap will be placed when adding it on live array? I.e. as it requires some diskspace, we should provide some free space, but where it can be taken from if array is already created and used by, say filesystem?

For 0.90 metadata there is 60K of unused space after the superblock.  The bitmap is stored there.

Quoted 7 lines

For 1.x, the metadata stores a data_offset and data_size.  All array data is in that range.  Anything out side there is available for mdadm to use. When mdadm creates an array it reserves enough space for bitmap and possible other uses.

NeilBrown

John, Neil, thanks for sharing this info! May be add it this to wiki?

Quoted 40 lines
Quoted 39 lines
Quoted 33 lines · Larkin Lowrey
Quoted 1 line · NeilBrown

On Mon, 19 Mar 2012 11:44:45 -0500 Larkin Lowrey

<[email protected]>

Quoted 10 lines
Quoted 7 lines · wrote:

The following command oopsed.

mdadm -G --bitmap=internal /dev/md0

The array is a two disk raid1 and hosts the root filesystem.

Is it not possible/allowed to add a bitmap to an active/mounted array?

Quoted 7 lines

It is. But it is busted.

Either use an older mdadm (3.2.2 or earlier), or apply this patch

http://neil.brown.name/git?p=md;a=commitdiff;h=4474ca42e2577563a919fd3ed782e2ec55bf11a2

which has been sent to Linus already and should appear in -stable

kernels in

Quoted 3 lines

a couple of weeks.

NeilBrown

Thank you for the explanation.

--Larkin

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Signature · 6 lines
Best regards,
[COOLCOLD-RIPN]
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html