[PATCH RFC 0/2] Block and buffer invalidation under a filesystem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

Recently Ye Bin has reported an ext4 crash which he tracked tracked down to a
problem that several places (block_write_full_page(), fallocate(2) on blkdev,
etc.) can invalidate buffers under a live filesystem - block_invalidatepage()
will clear (among other) BH_Mapped flag and following lookup of the buffer_head
will reinitialize it (init_page_buffers()) which among other things clears
bh->b_private fields which then makes jbd2 crash.

I was thinking how to best fix this. block_write_full_page() is easy to deal
with as the invalidation there is just a relict from the past and we don't need
to invalidate pages there at all (patch 1/2). Other cases are more
questionable. In patch 2/2, I have made fallocate(2) on the block device and
discard ioctls bail with EBUSY if there's filesystem mounted because it seems
very weird and problematic to mess with a block device like that under a
filesystem. What do people think? Is anyone aware of a user that would be
broken by this?

There are also other possibilities of fixing this like making
block_invalidatepage() (or rather new ->invalidatepage callback for the
block device) less aggressive so that it does not discard that much state from
buffer_heads. But details of that are not yet clear to me.

Or other possibilities people see to fix this?

								Honza



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux