linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maurizio Lombardi <mlombard@redhat.com>
To: linux-ext4@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca
Subject: [PATCH 1/2] ext4: fix wrong assert in ext4_mb_normalize_request()
Date: Mon,  3 Mar 2014 15:00:27 +0100	[thread overview]
Message-ID: <1393855228-13592-2-git-send-email-mlombard@redhat.com> (raw)
In-Reply-To: <1393855228-13592-1-git-send-email-mlombard@redhat.com>

the variable "size" is expressed as number of blocks and not as
number of clusters, this could trigger a kernel panic when using
ext4 with the size of a cluster different from the size of a block.

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
---
 fs/ext4/mballoc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 04a5c75..08ddfda 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -3135,7 +3135,7 @@ ext4_mb_normalize_request(struct ext4_allocation_context *ac,
 	}
 	BUG_ON(start + size <= ac->ac_o_ex.fe_logical &&
 			start > ac->ac_o_ex.fe_logical);
-	BUG_ON(size <= 0 || size > EXT4_CLUSTERS_PER_GROUP(ac->ac_sb));
+	BUG_ON(size <= 0 || size > EXT4_BLOCKS_PER_GROUP(ac->ac_sb));
 
 	/* now prepare goal request */
 
-- 
Maurizio Lombardi


  reply	other threads:[~2014-03-03 14:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-03 14:00 [PATCH 0/2] ext4: ext4_mb_normalize_request() fixes Maurizio Lombardi
2014-03-03 14:00 ` Maurizio Lombardi [this message]
2014-05-26 16:42   ` [PATCH 1/2] ext4: fix wrong assert in ext4_mb_normalize_request() Theodore Ts'o
2014-03-03 14:00 ` [PATCH 2/2] ext4: fix bug " Maurizio Lombardi
2014-03-06 15:44   ` Theodore Ts'o
2014-03-06 16:54     ` Maurizio Lombardi
2014-03-06 17:54       ` Lukáš Czerner
2014-03-06 18:32         ` Theodore Ts'o
2014-03-07 21:09           ` Andreas Dilger
2014-05-26 16:50         ` Theodore Ts'o
2014-06-03 18:43           ` Lukáš Czerner
2014-06-03 20:36             ` Theodore Ts'o
2014-06-06  7:09               ` Lukáš Czerner
2014-06-11  8:47               ` Maurizio Lombardi

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=1393855228-13592-2-git-send-email-mlombard@redhat.com \
    --to=mlombard@redhat.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@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;
as well as URLs for NNTP newsgroup(s).