WARN_ON_ONCE() in mark_buffer_dirty() being triggered during ext2umount of an 'errored' block device

From: Dan Aloni
Date: Sun Jan 16 2011 - 12:55:37 EST


Hello,

With a block device driver that I've implemented, I noticed that if
the block device is in an error state (i.e. all requests return
immediately with an error), and I invoke umount on an ext2 file system
mount on that block device, I get an unexpected kernel stack dump.

The relevant bits of the stack dump show that umount indirectly calls
mark_buffer_dirty(), and then the WARN_ON_ONCE(!buffer_uptodate(bh))
in mark_buffer_dirty() is triggered. I've seen this behavior with ext2
but did not test other file systems.

Now, I suspect this problem has something to do with
end_buffer_async_write() calling clear_buffer_uptodate(bh) but I'm no
VFS expert. The kernel is based on 2.6.32.12 but the code I'm talking
about seems to apply to latest as well.

Or - is it possible that I've mis-implemented the block device driver?

Thanks,
- Dan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/