public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add ENOSYS into sys_io_cancel
@ 2005-07-10 18:25 Shiow-wen Cheng
  0 siblings, 0 replies; 5+ messages in thread
From: Shiow-wen Cheng @ 2005-07-10 18:25 UTC (permalink / raw)
  To: bcrl; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 564 bytes --]

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 

[-- Attachment #2: 3748003194-cancel.patch --]
[-- Type: application/octet-stream, Size: 623 bytes --]

--- linux-2.6.12/fs/aio.c	2005-06-17 15:48:29.000000000 -0400
+++ linux/fs/aio.c	2005-07-10 12:48:14.000000000 -0400
@@ -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);
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] Add ENOSYS into sys_io_cancel
@ 2005-07-11 19:06 Wendy Cheng
  2005-07-12  1:48 ` Benjamin LaHaise
  0 siblings, 1 reply; 5+ messages in thread
From: Wendy Cheng @ 2005-07-11 19:06 UTC (permalink / raw)
  To: bcrl; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 541 bytes --]

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



[-- Attachment #2: cancel.patch --]
[-- Type: text/plain, Size: 623 bytes --]

--- linux-2.6.12/fs/aio.c	2005-06-17 15:48:29.000000000 -0400
+++ linux/fs/aio.c	2005-07-10 12:48:14.000000000 -0400
@@ -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);
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add ENOSYS into sys_io_cancel
  2005-07-11 19:06 [PATCH] Add ENOSYS into sys_io_cancel Wendy Cheng
@ 2005-07-12  1:48 ` Benjamin LaHaise
  2005-07-12 15:49   ` Wendy Cheng
  0 siblings, 1 reply; 5+ messages in thread
From: Benjamin LaHaise @ 2005-07-12  1:48 UTC (permalink / raw)
  To: Wendy Cheng; +Cc: linux-kernel

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 linux-aio@kvack.org on future aio patches.  Cheers,

		-ben 

On Mon, Jul 11, 2005 at 03:06:52PM -0400, Wendy Cheng wrote:
> 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
> 
> 

> --- linux-2.6.12/fs/aio.c	2005-06-17 15:48:29.000000000 -0400
> +++ linux/fs/aio.c	2005-07-10 12:48:14.000000000 -0400
> @@ -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);
>  


-- 
"Time is what keeps everything from happening all at once." -- John Wheeler

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add ENOSYS into sys_io_cancel
  2005-07-12  1:48 ` Benjamin LaHaise
@ 2005-07-12 15:49   ` Wendy Cheng
  2005-07-12 16:05     ` Benjamin LaHaise
  0 siblings, 1 reply; 5+ messages in thread
From: Wendy Cheng @ 2005-07-12 15:49 UTC (permalink / raw)
  To: Benjamin LaHaise; +Cc: linux-kernel, linux-aio

[-- Attachment #1: Type: text/plain, Size: 767 bytes --]

Benjamin LaHaise wrote:

>Also, please cc linux-aio@kvack.org 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

>On Mon, Jul 11, 2005 at 03:06:52PM -0400, Wendy Cheng wrote:
>
>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.
>
>  
>


[-- Attachment #2: aio.patch --]
[-- Type: text/plain, Size: 361 bytes --]

Signed-off-by: S. Wendy Cheng <wcheng@redhat.com>

--- linux-2.6.12/fs/aio.c	2005-06-17 15:48:29.000000000 -0400
+++ linux/fs/aio.c	2005-07-12 11:26:08.503256160 -0400
@@ -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);
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add ENOSYS into sys_io_cancel
  2005-07-12 15:49   ` Wendy Cheng
@ 2005-07-12 16:05     ` Benjamin LaHaise
  0 siblings, 0 replies; 5+ messages in thread
From: Benjamin LaHaise @ 2005-07-12 16:05 UTC (permalink / raw)
  To: Wendy Cheng; +Cc: linux-kernel, linux-aio

On Tue, Jul 12, 2005 at 11:49:47AM -0400, Wendy Cheng wrote:
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-07-12 16:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-11 19:06 [PATCH] Add ENOSYS into sys_io_cancel Wendy Cheng
2005-07-12  1:48 ` Benjamin LaHaise
2005-07-12 15:49   ` Wendy Cheng
2005-07-12 16:05     ` Benjamin LaHaise
  -- strict thread matches above, loose matches on Subject: below --
2005-07-10 18:25 Shiow-wen Cheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox