* [PATCH] e2image: fix invalid lseek error detection
@ 2011-08-24 8:00 Lukas Czerner
2011-08-24 16:02 ` Eric Sandeen
2011-09-14 17:28 ` Ted Ts'o
0 siblings, 2 replies; 4+ messages in thread
From: Lukas Czerner @ 2011-08-24 8:00 UTC (permalink / raw)
To: linux-ext4; +Cc: tytso, Lukas Czerner
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>
---
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;
--
1.7.4.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] e2image: fix invalid lseek error detection
2011-08-24 8:00 [PATCH] e2image: fix invalid lseek error detection Lukas Czerner
@ 2011-08-24 16:02 ` Eric Sandeen
2011-09-14 16:00 ` Lukas Czerner
2011-09-14 17:28 ` Ted Ts'o
1 sibling, 1 reply; 4+ messages in thread
From: Eric Sandeen @ 2011-08-24 16:02 UTC (permalink / raw)
To: Lukas Czerner; +Cc: linux-ext4, tytso
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;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] e2image: fix invalid lseek error detection
2011-08-24 16:02 ` Eric Sandeen
@ 2011-09-14 16:00 ` Lukas Czerner
0 siblings, 0 replies; 4+ messages in thread
From: Lukas Czerner @ 2011-09-14 16:00 UTC (permalink / raw)
To: Eric Sandeen; +Cc: Lukas Czerner, linux-ext4, tytso
On Wed, 24 Aug 2011, Eric Sandeen wrote:
> 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>
ping
>
> > ---
> > 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;
>
>
--
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] e2image: fix invalid lseek error detection
2011-08-24 8:00 [PATCH] e2image: fix invalid lseek error detection Lukas Czerner
2011-08-24 16:02 ` Eric Sandeen
@ 2011-09-14 17:28 ` Ted Ts'o
1 sibling, 0 replies; 4+ messages in thread
From: Ted Ts'o @ 2011-09-14 17:28 UTC (permalink / raw)
To: Lukas Czerner; +Cc: linux-ext4
On Wed, Aug 24, 2011 at 10:00:34AM +0200, 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>
Thanks, applied.
- Ted
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-09-14 17:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-24 8:00 [PATCH] e2image: fix invalid lseek error detection Lukas Czerner
2011-08-24 16:02 ` Eric Sandeen
2011-09-14 16:00 ` Lukas Czerner
2011-09-14 17:28 ` Ted Ts'o
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.