diff options
author | Christoph Hellwig <hch@lst.de> | 2021-06-17 16:22:12 +0200 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2021-06-21 15:29:24 -0600 |
commit | 45ddcb42949f825f0caa25352e825cede94b6aba (patch) | |
tree | bb4f4fb0bed56dda7e93aa113e10b1f8922e5175 /drivers/vfio/mdev/mdev_driver.c | |
parent | ef6dcbdd8eb2f44dce70a3abecc32d43cc5f3e64 (diff) | |
download | linux-45ddcb42949f825f0caa25352e825cede94b6aba.tar.gz linux-45ddcb42949f825f0caa25352e825cede94b6aba.tar.bz2 linux-45ddcb42949f825f0caa25352e825cede94b6aba.zip |
driver core: Don't return EPROBE_DEFER to userspace during sysfs bind
EPROBE_DEFER is an internal kernel error code and it should not be leaked
to userspace via the bind_store() sysfs. Userspace doesn't have this
constant and cannot understand it.
Further, it doesn't really make sense to have userspace trigger a deferred
probe via bind_store(), which could eventually succeed, while
simultaneously returning an error back.
Resolve this by splitting driver_probe_device so that the version used
by the sysfs binding that turns EPROBE_DEFER into -EAGAIN, while the one
used for internally binding keeps the error code, and calls
driver_deferred_probe_add where needed. This also allows to nicely split
out the defer_all_probes / probe_count checks so that they actually allow
for full device_{block,unblock}_probing protection while not bothering
the sysfs bind case.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20210617142218.1877096-5-hch@lst.de
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio/mdev/mdev_driver.c')
0 files changed, 0 insertions, 0 deletions