linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] fs: add missing unlock in default_llseek()
@ 2011-07-26 14:25 Dan Carpenter
  2011-07-26 14:31 ` Josef Bacik
  2011-07-26 16:50 ` Al Viro
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2011-07-26 14:25 UTC (permalink / raw)
  To: josef; +Cc: linux-kernel, linux-fsdevel, Alexander Viro


A recent change in linux-next, 982d816581 "fs: add SEEK_HOLE and
SEEK_DATA flags" added some direct returns on error, but it should
have been a goto out.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/fs/read_write.c b/fs/read_write.c
index 5907b49..179f1c3 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -166,8 +166,10 @@ loff_t default_llseek(struct file *file, loff_t offset, int origin)
 			 * long as offset isn't at the end of the file then the
 			 * offset is data.
 			 */
-			if (offset >= inode->i_size)
-				return -ENXIO;
+			if (offset >= inode->i_size) {
+				retval = -ENXIO;
+				goto out;
+			}
 			break;
 		case SEEK_HOLE:
 			/*
@@ -175,8 +177,10 @@ loff_t default_llseek(struct file *file, loff_t offset, int origin)
 			 * as long as offset isn't i_size or larger, return
 			 * i_size.
 			 */
-			if (offset >= inode->i_size)
-				return -ENXIO;
+			if (offset >= inode->i_size) {
+				retval = -ENXIO;
+				goto out;
+			}
 			offset = inode->i_size;
 			break;
 	}

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

* Re: [patch] fs: add missing unlock in default_llseek()
  2011-07-26 14:25 [patch] fs: add missing unlock in default_llseek() Dan Carpenter
@ 2011-07-26 14:31 ` Josef Bacik
  2011-07-26 16:50 ` Al Viro
  1 sibling, 0 replies; 3+ messages in thread
From: Josef Bacik @ 2011-07-26 14:31 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-kernel, linux-fsdevel, Alexander Viro

On 07/26/2011 10:25 AM, Dan Carpenter wrote:
> 
> A recent change in linux-next, 982d816581 "fs: add SEEK_HOLE and
> SEEK_DATA flags" added some direct returns on error, but it should
> have been a goto out.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/fs/read_write.c b/fs/read_write.c
> index 5907b49..179f1c3 100644
> --- a/fs/read_write.c
> +++ b/fs/read_write.c
> @@ -166,8 +166,10 @@ loff_t default_llseek(struct file *file, loff_t offset, int origin)
>  			 * long as offset isn't at the end of the file then the
>  			 * offset is data.
>  			 */
> -			if (offset >= inode->i_size)
> -				return -ENXIO;
> +			if (offset >= inode->i_size) {
> +				retval = -ENXIO;
> +				goto out;
> +			}
>  			break;
>  		case SEEK_HOLE:
>  			/*
> @@ -175,8 +177,10 @@ loff_t default_llseek(struct file *file, loff_t offset, int origin)
>  			 * as long as offset isn't i_size or larger, return
>  			 * i_size.
>  			 */
> -			if (offset >= inode->i_size)
> -				return -ENXIO;
> +			if (offset >= inode->i_size) {
> +				retval = -ENXIO;
> +				goto out;
> +			}
>  			offset = inode->i_size;
>  			break;
>  	}

Eeek copy+paste bites me again.  Thanks

Acked-by: Josef Bacik <josef@redhat.com>

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

* Re: [patch] fs: add missing unlock in default_llseek()
  2011-07-26 14:25 [patch] fs: add missing unlock in default_llseek() Dan Carpenter
  2011-07-26 14:31 ` Josef Bacik
@ 2011-07-26 16:50 ` Al Viro
  1 sibling, 0 replies; 3+ messages in thread
From: Al Viro @ 2011-07-26 16:50 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: josef, linux-kernel, linux-fsdevel

On Tue, Jul 26, 2011 at 05:25:20PM +0300, Dan Carpenter wrote:
> 
> A recent change in linux-next, 982d816581 "fs: add SEEK_HOLE and
> SEEK_DATA flags" added some direct returns on error, but it should
> have been a goto out.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Applied.

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

end of thread, other threads:[~2011-07-26 16:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-26 14:25 [patch] fs: add missing unlock in default_llseek() Dan Carpenter
2011-07-26 14:31 ` Josef Bacik
2011-07-26 16:50 ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).