From: Eric Sandeen <sandeen@redhat.com>
To: Lukas Czerner <lczerner@redhat.com>
Cc: linux-ext4@vger.kernel.org, tytso@mit.edu
Subject: Re: [PATCH] e2image: fix invalid lseek error detection
Date: Wed, 24 Aug 2011 11:02:48 -0500 [thread overview]
Message-ID: <4E5520A8.4030701@redhat.com> (raw)
In-Reply-To: <1314172834-18424-1-git-send-email-lczerner@redhat.com>
On 8/24/11 3:00 AM, Lukas Czerner wrote:
> In flush_l2_cache() we are using ext2fs_llseek() however we do not
> properly detect the error code returned from the function, because we
> are assigning it into ULL variable, hence we will not see negative
> values.
>
> Fix this by changing the type of the variable to ext2_loff_t which is
> signed and hence will store negative values.
>
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Yup!
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
> ---
> misc/e2image.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/misc/e2image.c b/misc/e2image.c
> index 83a9d02..bf0c0d4 100644
> --- a/misc/e2image.c
> +++ b/misc/e2image.c
> @@ -759,7 +759,8 @@ static void put_used_table(struct ext2_qcow2_image *img,
>
> static void flush_l2_cache(struct ext2_qcow2_image *image)
> {
> - blk64_t offset, seek = 0;
> + blk64_t seek = 0;
> + ext2_loff_t offset;
> struct ext2_qcow2_l2_cache *cache = image->l2_cache;
> struct ext2_qcow2_l2_table *table = cache->used_head;
> int fd = image->fd;
next prev parent reply other threads:[~2011-08-24 16:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-24 8:00 [PATCH] e2image: fix invalid lseek error detection Lukas Czerner
2011-08-24 16:02 ` Eric Sandeen [this message]
2011-09-14 16:00 ` Lukas Czerner
2011-09-14 17:28 ` Ted Ts'o
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=4E5520A8.4030701@redhat.com \
--to=sandeen@redhat.com \
--cc=lczerner@redhat.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox