__getblk() spinning when size != bdev->...i_blkbits
Recently I debugged something that was spinning in the for(;;) in __getblk_slow(). It turned out it was calling __getblk() with a size argument that didn't match the bdev's inode's i_blkbits.
grow_buffers() would add a page at the index calculated from the 4k size argument but when __getblk_slow() got back around to looking for the instantiated page __find_get_block_slow() would look at the index calculated from the 1k i_blkbits and not find the new page. Round and round she goes.
If the different size inputs are intentional, would a simple BUG_ON() be acceptible so that we can tell straight away if the caller messed up?
- z