From: Richard Yao <ryao-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
To: Richard Yao <ryao-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
Cc: Alexander Viro
<viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org>,
linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
kernel-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org,
zfs-devel-VKpPRiiRko4/ohRxsw7f2g@public.gmane.org
Subject: Re: [PATCH] fs: generic_file_llseek_size() should recognize invalid whence values
Date: Thu, 27 Jun 2013 22:24:57 -0400 [thread overview]
Message-ID: <51CCF3F9.5080500@gentoo.org> (raw)
In-Reply-To: <1372386158-11076-3-git-send-email-ryao-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]
Please disregard this patch. This was in my outgoing folder from
something that I had previously written, but it had no place being sent
to the list (again).
On 06/27/2013 10:22 PM, Richard Yao wrote:
> generic_file_llseek_size() handles whence values in a switch statement,
> but it lacks cases for both SEEK_SET and invalid values. This causes it
> to treat all invalid whence values as SEEK_SET, which is wrong.
>
> We fix that by adding a case for SEEK_SET and a default case.
>
> Signed-off-by: Richard Yao <ryao-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
> ---
> fs/read_write.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/fs/read_write.c b/fs/read_write.c
> index 0343000..54b8808 100644
> --- a/fs/read_write.c
> +++ b/fs/read_write.c
> @@ -81,6 +81,7 @@ generic_file_llseek_size(struct file *file, loff_t offset, int whence,
> switch (whence) {
> case SEEK_END:
> offset += eof;
> + case SEEK_SET:
> break;
> case SEEK_CUR:
> /*
> @@ -118,6 +119,8 @@ generic_file_llseek_size(struct file *file, loff_t offset, int whence,
> return -ENXIO;
> offset = eof;
> break;
> + default:
> + return -EINVAL;
> }
>
> return lseek_execute(file, inode, offset, maxsize);
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]
next prev parent reply other threads:[~2013-06-28 2:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-28 2:22 [PATCH] iterate_bdevs() should be exported Richard Yao
[not found] ` <1372386158-11076-1-git-send-email-ryao-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-06-28 2:22 ` [PATCH] fs: Export iterate_bdevs Richard Yao
2013-06-28 2:22 ` [PATCH] fs: generic_file_llseek_size() should recognize invalid whence values Richard Yao
[not found] ` <1372386158-11076-3-git-send-email-ryao-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-06-28 2:24 ` Richard Yao [this message]
2013-06-28 3:09 ` Al Viro
[not found] ` <20130628030959.GD4165-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2013-06-28 3:42 ` Richard Yao
-- strict thread matches above, loose matches on Subject: below --
2013-06-16 0:55 Richard Yao
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=51CCF3F9.5080500@gentoo.org \
--to=ryao-abrp7r+bbdudnm+yrofe0a@public.gmane.org \
--cc=kernel-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org \
--cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org \
--cc=zfs-devel-VKpPRiiRko4/ohRxsw7f2g@public.gmane.org \
/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.