On 02/03/2017 09:54 AM, Hannes Reinecke wrote:
The ioctl SET_FORCE_LOW_DMA has never worked since the initial
git check-in, and the respective setting is nowadays handled
correctly.
So disable it entirely.

Signed-off-by: Hannes Reinecke <h...@suse.com>
---

[...]

        case SG_SET_FORCE_LOW_DMA:
-               result = get_user(val, ip);
-               if (result)
-                       return result;
-               if (val) {
-                       sfp->low_dma = 1;
-                       if ((0 == sfp->low_dma) && (0 == sg_res_in_use(sfp))) {
-                               val = (int) sfp->reserve.bufflen;
-                               sg_remove_scat(sfp, &sfp->reserve);
-                               sg_build_reserve(sfp, val);
-                       }
-               } else {
-                       if (atomic_read(&sdp->detaching))
-                               return -ENODEV;
-                       sfp->low_dma = sdp->device->host->unchecked_isa_dma;
-               }
-               return 0;
+               return -EINVAL;

I'm not sure if returning a bogus '0' is better here to not break any existing application, which assumed it always worked.


Reply via email to