Skip to contentSkip to conversation

Add ENOSYS into sys_io_cancel

PATCH In review Wendy Cheng 2 participants 4 messages Jul 11, 2005 – Jul 12, 2005

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

PATCH 1/1 Add ENOSYS into sys_io_cancel

Previously sent via private mail that doesn't seem to go thru - resend via office mailer.

Note that other than few exceptions, most of the current filesystem and/or drivers do not have aio cancel specifically defined (kiob->ki_cancel field is mostly NULL). However, sys_io_cancel system call universally sets return code to -EGAIN. This gives applications a wrong impression that this call is implemented but just never works. We have customer inquires about this issue.

Upload a trivial patch to address this confusion.

-- Wendy

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);
 
maintainer
#1 lore raw

Hello Wendy,

Two things: your patch needs to be properly signed off on. Read Documentation/SubmittingPatches for a description of what that entials. Secondly, your patch adds whitespace on the end of the else. Aside from that, the printk should be removed -- just replace it with the ret = -ENOSYS.

Also, please cc [email protected] on future aio patches. Cheers,

-ben

Quoted 41 lines · Wendy Cheng

Previously sent via private mail that doesn't seem to go thru - resend via office mailer.

Note that other than few exceptions, most of the current filesystem and/or drivers do not have aio cancel specifically defined (kiob->ki_cancel field is mostly NULL). However, sys_io_cancel system call universally sets return code to -EGAIN. This gives applications a wrong impression that this call is implemented but just never works. We have customer inquires about this issue.

Upload a trivial patch to address this confusion.

-- Wendy

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);
 
Signature · 1 line
"Time is what keeps everything from happening all at once." -- John Wheeler
#2 lore raw
Quoted 3 lines · Benjamin LaHaise

Also, please cc [email protected] on future aio patches.

Didn't realize the patch was sent to linux-kernel (that I don't subscribe) instead of linux-aio - revised patch attached. Thanks for the help .... Wendy

Quoted 8 lines · Wendy Cheng

Note that other than few exceptions, most of the current filesystem and/or drivers do not have aio cancel specifically defined (kiob->ki_cancel field is mostly NULL). However, sys_io_cancel system call universally sets return code to -EGAIN. This gives applications a wrong impression that this call is implemented but just never works. We have customer inquires about this issue.

Upload a trivial patch to address this confusion.

fs/aio.c +1 -1
@@ -1660,7 +1660,7 @@ asmlinkage long sys_io_cancel(aio_contex
 				ret = -EFAULT;
 		}
 	} else
-		printk(KERN_DEBUG "iocb has no cancel operation\n");
+		ret = -ENOSYS;
 
 	put_ioctx(ctx);
 
maintainer
#3 lore raw
Quoted 3 lines · Wendy Cheng

Didn't realize the patch was sent to linux-kernel (that I don't subscribe) instead of linux-aio - revised patch attached. Thanks for the help .... Wendy

Okay, applied. Thanks!

-ben