On Sat, Nov 17, 2018 at 04:53:17PM -0700, Jens Axboe wrote: > Needs further work, but this should work fine on normal setups > with a file system on a pollable block device. > > Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> > --- > fs/aio.c | 2 ++ > fs/direct-io.c | 4 +++- > fs/iomap.c | 7 +++++-- > 3 files changed, 10 insertions(+), 3 deletions(-) > > diff --git a/fs/aio.c b/fs/aio.c > index 500da3ffc376..e02085fe10d7 100644 > --- a/fs/aio.c > +++ b/fs/aio.c > @@ -1310,6 +1310,8 @@ static struct block_device *aio_bdev_host(struct kiocb *req) > > if (S_ISBLK(inode->i_mode)) > return I_BDEV(inode); > + else if (inode->i_sb && inode->i_sb->s_bdev) > + return inode->i_sb->s_bdev; This is broken for multi-device filesystems, e.g. XFS with the RT device, or btrfs. See my patch in reply to your last one for an idea how to solve this.