On 02/03/2017 10:32 AM, Johannes Thumshirn wrote: > > 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 <hare@xxxxxxxx> >> --- > > [...] > >> 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. > Well, the ioctl already was returning error numbers, so any calling application had to protect against that. And I don't really see the point to protect against failures in legacy applications relying on a functionality which never did anything. Cheers, Hannes -- Dr. Hannes Reinecke zSeries & Storage hare@xxxxxxxx +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)