From: Andreas Hindborg <a.hindborg@kernel.org>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org,
"Richard W . M . Jones" <rjones@redhat.com>,
Ming Lei <ming.lei@redhat.com>, Jeff Moyer <jmoyer@redhat.com>,
Jiri Jaburek <jjaburek@redhat.com>,
Christoph Hellwig <hch@lst.de>,
Bart Van Assche <bvanassche@acm.org>,
Hannes Reinecke <hare@suse.de>,
Chaitanya Kulkarni <kch@nvidia.com>,
Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Subject: Re: [PATCH v2] block: Fix elv_iosched_local_module handling of "none" scheduler
Date: Mon, 07 Oct 2024 12:51:50 +0200 [thread overview]
Message-ID: <87ed4snq2h.fsf@kernel.org> (raw)
In-Reply-To: <20240917133231.134806-1-dlemoal@kernel.org> (Damien Le Moal's message of "Tue, 17 Sep 2024 22:32:31 +0900")
Hi Damien,
Damien Le Moal <dlemoal@kernel.org> writes:
> Commit 734e1a860312 ("block: Prevent deadlocks when switching
> elevators") introduced the function elv_iosched_load_module() to allow
> loading an elevator module outside of elv_iosched_store() with the
> target device queue not frozen, to avoid deadlocks. However, the "none"
> scheduler does not have a module and as a result,
> elv_iosched_load_module() always returns an error when trying to switch
> to this valid scheduler.
The commit message here is a bit misleading. The problem is not that
`request_module` can fail, the problem is that some failure modes cause
this function to return a positive integer. This is not caught by
callers and it ends up causing all kinds of problems in user space.
Perhaps it makes sense to check for a positive return value at the call
site of the `load_module` pointer in `queue_attr_store`, so this does
not repeat at some point in the future?
Or maybe document that `load_module` implementations should not return a
positive value unless it actually wants to send this to user space as
the result of a write to the `scheduler` sysfs file?
Best regards,
Andreas
next prev parent reply other threads:[~2024-10-07 10:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-17 13:32 [PATCH v2] block: Fix elv_iosched_local_module handling of "none" scheduler Damien Le Moal
2024-09-17 13:33 ` Christoph Hellwig
2024-09-17 14:34 ` Jens Axboe
2024-10-07 10:51 ` Andreas Hindborg [this message]
2024-10-07 22:48 ` Damien Le Moal
2024-10-08 4:20 ` Christoph Hellwig
2024-10-08 5:13 ` Damien Le Moal
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 \
--in-reply-to=87ed4snq2h.fsf@kernel.org \
--to=a.hindborg@kernel.org \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=dlemoal@kernel.org \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=jjaburek@redhat.com \
--cc=jmoyer@redhat.com \
--cc=kch@nvidia.com \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=rjones@redhat.com \
--cc=shinichiro.kawasaki@wdc.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.