aoe: don't call set_capacity from irq context
authorChristoph Hellwig <hch@lst.de>
Mon, 16 Nov 2020 14:57:02 +0000 (15:57 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 16 Nov 2020 15:34:14 +0000 (08:34 -0700)
commit8a6f7bbf29d1d61d3ff18f0a0feead9f287c9b14
tree88d7e6a4845d3a09eec81bc577fc7d7d31282fd5
parent2ebcabf3dba50f61850efec9a331bd061c6333e0
aoe: don't call set_capacity from irq context

Updating the block device size from irq context can lead to torn
writes of the 64-bit value, and prevents us from using normal
process context locking primitives to serialize access to the 64-bit
nr_sectors value.  Defer the set_capacity to the already existing
workqueue handler, where it can be merged with the update of the
block device size by using set_capacity_and_notify.  As an extra
bonus this also adds proper uevent notifications for the resize.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/aoe/aoecmd.c