linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH] ext4: Fix 64-bit block type problem on 32-bit platforms
Date: Sun, 14 Jun 2009 23:07:10 -0500	[thread overview]
Message-ID: <4A35C8EE.8070700@redhat.com> (raw)
In-Reply-To: <1245015002-16880-1-git-send-email-tytso@mit.edu>

Theodore Ts'o wrote:
> The function ext4_mb_free_blocks() was using an "unsigned long" to
> pass a block number; this will cause 64-bit block numbers to get
> truncated on x86 and other 32-bit platforms.
> 
> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>

Yup, good catch.

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> ---
>  fs/ext4/ext4.h    |    2 +-
>  fs/ext4/mballoc.c |    8 ++++----
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
> index 746cdcb..17b9998 100644
> --- a/fs/ext4/ext4.h
> +++ b/fs/ext4/ext4.h
> @@ -1341,7 +1341,7 @@ extern void ext4_discard_preallocations(struct inode *);
>  extern int __init init_ext4_mballoc(void);
>  extern void exit_ext4_mballoc(void);
>  extern void ext4_mb_free_blocks(handle_t *, struct inode *,
> -		unsigned long, unsigned long, int, unsigned long *);
> +		ext4_fsblk_t, unsigned long, int, unsigned long *);
>  extern int ext4_mb_add_groupinfo(struct super_block *sb,
>  		ext4_group_t i, struct ext4_group_desc *desc);
>  extern void ext4_mb_update_group_info(struct ext4_group_info *grp,
> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
> index 8d98070..519a0a6 100644
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@ -4689,7 +4689,7 @@ ext4_mb_free_metadata(handle_t *handle, struct ext4_buddy *e4b,
>   * Main entry point into mballoc to free blocks
>   */
>  void ext4_mb_free_blocks(handle_t *handle, struct inode *inode,
> -			unsigned long block, unsigned long count,
> +			ext4_fsblk_t block, unsigned long count,
>  			int metadata, unsigned long *freed)
>  {
>  	struct buffer_head *bitmap_bh = NULL;
> @@ -4715,11 +4715,11 @@ void ext4_mb_free_blocks(handle_t *handle, struct inode *inode,
>  	    block + count > ext4_blocks_count(es)) {
>  		ext4_error(sb, __func__,
>  			    "Freeing blocks not in datazone - "
> -			    "block = %lu, count = %lu", block, count);
> +			    "block = %llu, count = %lu", block, count);
>  		goto error_return;
>  	}
>  
> -	ext4_debug("freeing block %lu\n", block);
> +	ext4_debug("freeing block %llu\n", block);
>  	trace_ext4_free_blocks(inode, block, count, metadata);
>  
>  	ac = kmem_cache_alloc(ext4_ac_cachep, GFP_NOFS);
> @@ -4761,7 +4761,7 @@ do_more:
>  
>  		ext4_error(sb, __func__,
>  			   "Freeing blocks in system zone - "
> -			   "Block = %lu, count = %lu", block, count);
> +			   "Block = %llu, count = %lu", block, count);
>  		/* err = 0. ext4_std_error should be a no op */
>  		goto error_return;
>  	}


      reply	other threads:[~2009-06-15  4:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-14 21:30 [PATCH] ext4: Fix 64-bit block type problem on 32-bit platforms Theodore Ts'o
2009-06-15  4:07 ` Eric Sandeen [this message]

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=4A35C8EE.8070700@redhat.com \
    --to=sandeen@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;
as well as URLs for NNTP newsgroup(s).