public inbox for [email protected]
 help / color / mirror / Atom feed
From: Christoph Hellwig <[email protected]>
To: hexue <[email protected]>
Cc: [email protected], [email protected],
	[email protected], [email protected]
Subject: Re: [PATCH v2] io_uring: Avoid polling configuration errors
Date: Thu, 11 Jul 2024 22:20:31 -0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On Thu, Jul 11, 2024 at 04:24:30PM +0800, hexue wrote:
> +	if (!ctx->check_poll_queue) {
> +		struct block_device *bdev;
> +		struct request_queue *q;
> +		struct inode *inode = req->file->f_inode;
> +
> +		if (inode->i_rdev) {
> +			bdev = blkdev_get_no_open(inode->i_rdev);
> +			q = bdev->bd_queue;
> +			if (!test_bit(QUEUE_FLAG_POLL, &q->queue_flags))
> +				pr_warn("the device does't configured with poll queues\n");
> +		}
> +		ctx->check_poll_queue = true;
> +	}

This is wrong for multiple reasons.  One is that we can't simply poke
into block device internals like this in a higher layer like io_uring.
Second blkdev_get_no_open is in no way available for use outside the
block layer.  The fact that the even exist as separate helpers that
aren't entirely hidden is a decade old layering violation in blk-cgroup.

If you want to advertize this properly we'll need a flag in struct
file or something similar.


  reply	other threads:[~2024-07-12  5:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20240711082438epcas5p3732ee8528964d2334f5670e36b0c3f10@epcas5p3.samsung.com>
2024-07-11  8:24 ` [PATCH v2] io_uring: Avoid polling configuration errors hexue
2024-07-12  5:20   ` Christoph Hellwig [this message]
     [not found]     ` <CGME20240712065750epcas5p2149131922a27554e6a40313e5c73699e@epcas5p2.samsung.com>
2024-07-12  6:57       ` hexue
2024-07-12 15:36         ` Jens Axboe
     [not found]           ` <CGME20240715023908epcas5p1e16b2ac82c7f61edf44bfd874c920f04@epcas5p1.samsung.com>
2024-07-15  2:39             ` hexue
2024-07-15 10:59               ` Jens Axboe
     [not found]                 ` <CGME20240716071617epcas5p11b0423d0ee1c66167f7658c071384586@epcas5p1.samsung.com>
2024-07-16  7:16                   ` hexue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox