Skip to contentSkip to conversation

Add ENOSYS into sys_io_cancel

PATCH New Shiow-wen Cheng 1 participant 1 message Jul 10, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add ENOSYS into sys_io_cancel

Other than few exceptions (e.g. usb/gadget), none of the current filesystems and/or drivers that has io_cancel implemented (kiocb->ki_cancel left with NULL). However, the io_cancel() system call (sys_io_cancel) somehow universally sets return code to -EAGAIN. This gives us a false impression that io_cancel() is supported (implemented) but just never works - would appreciate if this patch is taken.

-- s.w.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

fs/aio.c +5 -2
@@ -1641,8 +1641,9 @@ asmlinkage long sys_io_cancel(aio_contex
 		cancel = kiocb->ki_cancel;
 		kiocb->ki_users ++;
 		kiocbSetCancelled(kiocb);
-	} else
+	} else 
 		cancel = NULL;
+	 
 	spin_unlock_irq(&ctx->ctx_lock);
 
 	if (NULL != cancel) {
@@ -1659,8 +1660,10 @@ asmlinkage long sys_io_cancel(aio_contex
 			if (copy_to_user(result, &tmp, sizeof(tmp)))
 				ret = -EFAULT;
 		}
-	} else
+	} else {
+		ret = -ENOSYS;
 		printk(KERN_DEBUG "iocb has no cancel operation\n");
+	} 
 
 	put_ioctx(ctx);