Skip to contentSkip to conversation

domU oom -> xvda1 read-only without any notice?

DISCUSSION Josip Rodin 4 participants 13 messages Mar 31, 2010 – Apr 1, 2010

lore
Share & tools
lore
#0 lore raw

Hi,

Two days ago a resource-intensive process caused one of my new 2.6.32 domUs to crash and burn, so yesterday I recompiled the kernel with debug options and retried it. In the early hours of today, after a few hours of running the same process, the kernel noticed an OOM again and started killing Apache and PostgreSQL. Unfortunately what also happened was that the root partition (/dev/xvda1) was somehow marked read-only. I tried to remount it from within domU, but I just got:

% sudo mount -o remount,rw /
mount: block device /dev/xvda1 is write-protected, mounting read-only

There are no messages in the kernel log on either the .32 domU or the .26 dom0. What do I do, other than shutdown and re-create? How does one manually 'talk' to blkback to see what's up?

Signature · 1 line
     2. That which causes joy or happiness.
#1 lore raw
Quoted 6 lines · Josip Rodin

% sudo mount -o remount,rw /
mount: block device /dev/xvda1 is write-protected, mounting read-only

There are no messages in the kernel log on either the .32 domU or the .26 dom0. What do I do, other than shutdown and re-create? How does one manually 'talk' to blkback to see what's up?

Blkback communicates this kind of info to blkfront via a node in xenstore named 'info'. Bit 2 of this numeric field indicates if a virtual disc is read-only. I think it's more likely that the domU has internally confused itself, rather than being told to mount read-only by dom0 -- the flags get probed when the virtual disc first appears, and I don't think would get probed again after that anyway without a full disc hot-unplug/replug.

-- Keir

#12 lore raw
In reply to Josip Rodin
Quoted 8 lines · joy

Two days ago a resource-intensive process caused one of my new 2.6.32 domUs to crash and burn, so yesterday I recompiled the kernel with debug options and retried it. In the early hours of today, after a few hours of running the same process, the kernel noticed an OOM again and started killing Apache and PostgreSQL. Unfortunately what also happened was that the root partition (/dev/xvda1) was somehow marked read-only. I tried to remount it from within domU, but I just got:

Quoted 6 lines

% sudo mount -o remount,rw /
mount: block device /dev/xvda1 is write-protected, mounting read-only

There are no messages in the kernel log on either the .32 domU or the .26 dom0. What do I do, other than shutdown and re-create? How does one manually 'talk' to blkback to see what's up?

On the dom0 I found /sys/module/blkbk/parameters/{debug_lvl,log_stats}. Echoing 1 into the latter got me:

[1053818.198356] blkback.1.hda1: oo 22161  |  rd 143219463  |  wr 70692159  |  br    0
[1053818.556417] blkback.1.hda2: oo 45794  |  rd 41644778  |  wr -2072774999  |  br    0
[1053819.957581] blkback.2.hda1: oo 5277  |  rd 35391  |  wr 2396186  |  br    0
[1053828.277147] blkback.1.hda1: oo   0  |  rd  275  |  wr  592  |  br    0
[1053828.802488] blkback.1.hda2: oo   0  |  rd   50  |  wr 22689  |  br    0
[1053835.086327] blkback.2.hda1: oo   0  |  rd    0  |  wr   85  |  br    0

And so on. Another attempt at remount didn't provoke any reaction, and I had also set debug_lvl.

Signature · 1 line
     2. That which causes joy or happiness.
#2 lore raw
In reply to Keir Fraser
Quoted 9 lines · Keir Fraser
Quoted 6 lines · Josip Rodin

% sudo mount -o remount,rw /
mount: block device /dev/xvda1 is write-protected, mounting read-only

There are no messages in the kernel log on either the .32 domU or the .26 dom0. What do I do, other than shutdown and re-create? How does one manually 'talk' to blkback to see what's up?

Quoted 6 lines

Blkback communicates this kind of info to blkfront via a node in xenstore named 'info'. Bit 2 of this numeric field indicates if a virtual disc is read-only. I think it's more likely that the domU has internally confused itself, rather than being told to mount read-only by dom0 -- the flags get probed when the virtual disc first appears, and I don't think would get probed again after that anyway without a full disc hot-unplug/replug.

OK, thanks, so is there any way I could examine xen-blkfront then? :) I looked around and only found funny bits like:

% cat /sys/module/xen_blkfront/drivers/xen:vbd/vbd-51713/block/xvda1/ro 0

Signature · 1 line
     2. That which causes joy or happiness.
#3 lore raw
Quoted 7 lines · Josip Rodin
Quoted 6 lines

Blkback communicates this kind of info to blkfront via a node in xenstore named 'info'. Bit 2 of this numeric field indicates if a virtual disc is read-only. I think it's more likely that the domU has internally confused itself, rather than being told to mount read-only by dom0 -- the flags get probed when the virtual disc first appears, and I don't think would get probed again after that anyway without a full disc hot-unplug/replug.

Quoted 5 lines

OK, thanks, so is there any way I could examine xen-blkfront then? :) I looked around and only found funny bits like:

% cat /sys/module/xen_blkfront/drivers/xen:vbd/vbd-51713/block/xvda1/ro 0

AFAIK that means that the read-only-ness is not being propagated up to domU block layer by the xen_blockfront driver. I'm not sure exactly what other possibilities there are, but if the kernel has been OOMing processes then perhaps you're in a runlevel or mode, or even a kenrel bug, in which rootfs is forced read-only for other reasons? There have been bugs around OOM in the past, and really it's a kernel path that's obviously best avoided! Any idea why the OOM occurred in the first place?

-- Keir

#4 lore raw
Quoted 13 lines · Keir Fraser
Quoted 7 lines
Quoted 6 lines

Blkback communicates this kind of info to blkfront via a node in xenstore named 'info'. Bit 2 of this numeric field indicates if a virtual disc is read-only. I think it's more likely that the domU has internally confused itself, rather than being told to mount read-only by dom0 -- the flags get probed when the virtual disc first appears, and I don't think would get probed again after that anyway without a full disc hot-unplug/replug.

Quoted 5 lines

OK, thanks, so is there any way I could examine xen-blkfront then? :) I looked around and only found funny bits like:

% cat /sys/module/xen_blkfront/drivers/xen:vbd/vbd-51713/block/xvda1/ro 0

Quoted 7 lines

AFAIK that means that the read-only-ness is not being propagated up to domU block layer by the xen_blockfront driver. I'm not sure exactly what other possibilities there are, but if the kernel has been OOMing processes then perhaps you're in a runlevel or mode, or even a kenrel bug, in which rootfs is forced read-only for other reasons? There have been bugs around OOM in the past, and really it's a kernel path that's obviously best avoided! Any idea why the OOM occurred in the first place?

Not really. It's prompted by a skipfish (web security scanner) run on the web server on the same machine, and that server has PHP that talks to the database. It does nicely for a few hours, then it bursts into flames. The 2.6.26 domU kernel reliably died completely in that situation, it's that SMP bug with the old forward-ported Xen patches. The new kernel survived some OOM situations, and obviously some others not so much :) This is the first time I saw it break blkfront, so I figured it may be useful to report early in case I can gather some more debug info now.

If nobody has any immediate suggestions as to what to do, I'm going to restart it now because we need the machine in a not-so-useless state. But I'll probably reproduce the same problem tonight anyway.

Signature · 1 line
     2. That which causes joy or happiness.
#9 lore raw
In reply to Keir Fraser
Quoted 9 lines · Keir Fraser

AFAIK that means that the read-only-ness is not being propagated up to domU block layer by the xen_blockfront driver. I'm not sure exactly what other possibilities there are, but if the kernel has been OOMing processes then perhaps you're in a runlevel or mode, or even a kenrel bug, in which rootfs is forced read-only for other reasons? There have been bugs around OOM in the past, and really it's a kernel path that's obviously best avoided! Any idea why the OOM occurred in the first place?

Root filesystems are often mounted with the "errors=remount-ro" option (is it the Debian default?). So it's possible this is a domU decision to go read-only, but the question remains as to what happened in the domU to trigger this decision, can an OOM do that? There might be something earlier in the domU dmesg?

Ian.

#10 lore raw
Quoted 10 lines · Ian Campbell
Quoted 8 lines · Keir Fraser

AFAIK that means that the read-only-ness is not being propagated up to domU block layer by the xen_blockfront driver. I'm not sure exactly what other possibilities there are, but if the kernel has been OOMing processes then perhaps you're in a runlevel or mode, or even a kenrel bug, in which rootfs is forced read-only for other reasons? There have been bugs around OOM in the past, and really it's a kernel path that's obviously best avoided! Any idea why the OOM occurred in the first place?

Quoted 5 lines

Root filesystems are often mounted with the "errors=remount-ro" option (is it the Debian default?). So it's possible this is a domU decision to go read-only, but the question remains as to what happened in the domU to trigger this decision, can an OOM do that? There might be something earlier in the domU dmesg?

Yes, it's the default, but it doesn't explain why I can't go *back* to rw. remount-ro should be functionally equivalent to mount -o remount,ro /, but something made the system think that the block device is read-only.

And, there's nothing out of the OOM context in dmesg, as in, nothing mentions xvda explicitly, but here's the entire kernel log from the last boot to the end. (Hopefully the list allows gzipped attachments, it's a lot of text.)

Signature · 1 line
     2. That which causes joy or happiness.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#5 lore raw
In reply to Josip Rodin
Quoted 2 lines · Josip Rodin

I'm going to restart it now because we need the machine in a not-so-useless state.

After the shutdown and create:

[...]

[    0.488419] blkfront: xvda1: barriers enabled
done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
[    0.670172] EXT3-fs: INFO: recovery required on readonly filesystem.
[    0.670186] EXT3-fs: write access will be enabled during recovery.
[    9.996563] kjournald starting.  Commit interval 5 seconds
[    9.996577] EXT3-fs warning (device xvda1): ext3_clear_journal_err: Filesystem error recorded from previous mount: IO failure
[    9.996585] EXT3-fs warning (device xvda1): ext3_clear_journal_err: Marking fs in need of filesystem check.
[    9.996991] EXT3-fs: recovery complete.
[    9.997318] EXT3-fs: mounted filesystem with ordered data mode.

[...]
Will now check root file system:fsck 1.41.3 (12-Oct-2008)
[/sbin/fsck.ext3 (1) -- /] fsck.ext3 -a -C0 /dev/xvda1
lastovo-root contains a file system with errors, check forced.
Deleted inode 1704618 has zero dtime. FIXED.
lastovo-root: ***** REBOOT LINUX *****
lastovo-root: 1046964/3276800 files (1.1% non-contiguous), 10147312/13107200 blocks
fsck died with exit status 3
failed!
The file system check corrected errors on the root partition but requested that the system be restarted. failed! The system will be restarted in 5 seconds. (warning).
Will now restart.

Then it booted fine.

I examined the graphs of the machine from the time of the incident, and it seems that everything was fine until around 2:30 when a large network operation started - Legato nsrexecd was backing it up - its remote logs say it transferred 4 GB of data in around 11 minutes, and finished successfully. At that point, the graphs on the machine recorded a huge spike in both Apache and PostgreSQL connections, and then soon after the whole thing went AWOL. If necessary I can attach the entire graph snapshot, which also includes the approximated state of /proc/interrupts and /proc/meminfo.

Signature · 1 line
     2. That which causes joy or happiness.
#11 lore raw
In reply to Josip Rodin
Quoted 17 lines · Josip Rodin
Quoted 10 lines · Ian Campbell
Quoted 8 lines · Keir Fraser

AFAIK that means that the read-only-ness is not being propagated up to domU block layer by the xen_blockfront driver. I'm not sure exactly what other possibilities there are, but if the kernel has been OOMing processes then perhaps you're in a runlevel or mode, or even a kenrel bug, in which rootfs is forced read-only for other reasons? There have been bugs around OOM in the past, and really it's a kernel path that's obviously best avoided! Any idea why the OOM occurred in the first place?

Quoted 5 lines

Root filesystems are often mounted with the "errors=remount-ro" option (is it the Debian default?). So it's possible this is a domU decision to go read-only, but the question remains as to what happened in the domU to trigger this decision, can an OOM do that? There might be something earlier in the domU dmesg?

Quoted 3 lines

Yes, it's the default, but it doesn't explain why I can't go *back* to rw. remount-ro should be functionally equivalent to mount -o remount,ro /, but something made the system think that the block device is read-only.

I'm not sure about that. It's possible that whatever the original error was it caused the system to also mark the underlying block device as ro at the same time as the remount,ro and therefore going back to rw is not possible.

Ian.

#6 lore raw
In reply to Josip Rodin

On Wed, 2010-03-31 at 10:17 +0100, Josip Rodin wrote:
Is it possible that this (which I presume is a flag set in the filesystem metadata):

Quoted 2 lines
[    9.996577] EXT3-fs warning (device xvda1): ext3_clear_journal_err: Filesystem error recorded from previous mount: IO failure
[    9.996585] EXT3-fs warning (device xvda1): ext3_clear_journal_err: Marking fs in need of filesystem check.

would also have caused the filesystem to reject attempts to remount,rw before the reboot until you rebooted and fsck ran?

I took a look at your logs (other mail) and I can't see any mention of an IO error on xvda either -- I must admit I'm pretty perplexed :-(

Ian.

#7 lore raw
Quoted 4 lines · Ian Campbell

On Wed, 2010-03-31 at 10:17 +0100, Josip Rodin wrote:
Is it possible that this (which I presume is a flag set in the filesystem metadata):

Quoted 8 lines
Quoted 2 lines
[    9.996577] EXT3-fs warning (device xvda1): ext3_clear_journal_err: Filesystem error recorded from previous mount: IO failure
[    9.996585] EXT3-fs warning (device xvda1): ext3_clear_journal_err: Marking fs in need of filesystem check.

would also have caused the filesystem to reject attempts to remount,rw before the reboot until you rebooted and fsck ran?

I took a look at your logs (other mail) and I can't see any mention of an IO error on xvda either -- I must admit I'm pretty perplexed :-(

OTOH you shouldn't be surprised about not finding anything in the logs about the filesystem being read-only. :) Dmesg would have a bigger chance of containing some traces, or network logs, if present.

Signature · 2 lines
Regards,
Feri.
#8 lore raw
Quoted 9 lines · Ferenc Wagner
Quoted 7 lines · Ian Campbell

On Wed, 2010-03-31 at 10:17 +0100, Josip Rodin wrote:
Is it possible that this (which I presume is a flag set in the filesystem metadata):

Quoted 2 lines
[    9.996577] EXT3-fs warning (device xvda1): ext3_clear_journal_err: Filesystem error recorded from previous mount: IO failure
[    9.996585] EXT3-fs warning (device xvda1): ext3_clear_journal_err: Marking fs in need of filesystem check.
Quoted 8 lines
Quoted 5 lines

would also have caused the filesystem to reject attempts to remount,rw before the reboot until you rebooted and fsck ran?

I took a look at your logs (other mail) and I can't see any mention of an IO error on xvda either -- I must admit I'm pretty perplexed :-(

OTOH you shouldn't be surprised about not finding anything in the logs about the filesystem being read-only. :)

Doh, yes, right ;)

Ian.