From: Lukas Czerner <lczerner@redhat.com>
To: linux-ext4@vger.kernel.org
Cc: tytso@mit.edu, Lukas Czerner <lczerner@redhat.com>
Subject: [PATCH] e2image: fix invalid lseek error detection
Date: Wed, 24 Aug 2011 10:00:34 +0200 [thread overview]
Message-ID: <1314172834-18424-1-git-send-email-lczerner@redhat.com> (raw)
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
next reply other threads:[~2011-08-24 8:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-24 8:00 Lukas Czerner [this message]
2011-08-24 16:02 ` [PATCH] e2image: fix invalid lseek error detection Eric Sandeen
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=1314172834-18424-1-git-send-email-lczerner@redhat.com \
--to=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