From: Josef Bacik <josef@redhat.com>
To: Dan Carpenter <error27@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
Alexander Viro <viro@zeniv.linux.org.uk>
Subject: Re: [patch] fs: add missing unlock in default_llseek()
Date: Tue, 26 Jul 2011 10:31:26 -0400 [thread overview]
Message-ID: <4E2ECFBE.60602@redhat.com> (raw)
In-Reply-To: <20110726142520.GG3824@shale.localdomain>
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>
next prev parent reply other threads:[~2011-07-26 14:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-26 14:25 [patch] fs: add missing unlock in default_llseek() Dan Carpenter
2011-07-26 14:31 ` Josef Bacik [this message]
2011-07-26 16:50 ` Al Viro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E2ECFBE.60602@redhat.com \
--to=josef@redhat.com \
--cc=error27@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.