[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 5/9] ext2fs: fix type of inum
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 5/9] ext2fs: fix type of inum |
Date: |
Mon, 28 Apr 2014 12:34:43 +0200 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Justus Winter, le Mon 28 Apr 2014 12:20:00 +0200, a écrit :
> Previously, inum was of type int, whereas dino_ref expects ino_t. On
> Hurd/x86 the former is 32 bit wide, the latter 64. If dino_ref is
> inlined, this does not seem to pose a problem, but if ext2fs is
> compiled with -O0, this most likely results in an invalid memory access.
Why would there be an invalid memory access? The compiler will just
truncate the value before passing it as scalar parameter.
But it's a good thing anyway indeed, ack :)
> * ext2fs/ialloc.c (ext2_alloc_inode): Use type ino_t for inum.
> ---
> ext2fs/ialloc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/ext2fs/ialloc.c b/ext2fs/ialloc.c
> index 2d8e51e..52212d5 100644
> --- a/ext2fs/ialloc.c
> +++ b/ext2fs/ialloc.c
> @@ -115,7 +115,8 @@ ino_t
> ext2_alloc_inode (ino_t dir_inum, mode_t mode)
> {
> char *bh = NULL;
> - int i, j, inum, avefreei;
> + int i, j, avefreei;
> + ino_t inum;
> struct ext2_group_desc *gdp;
> struct ext2_group_desc *tmp;
>
> --
> 1.9.2
>
--
Samuel
I develop for Linux for a living, I used to develop for DOS.
Going from DOS to Linux is like trading a glider for an F117.
(By entropy@world.std.com, Lawrence Foard)
- Re: [PATCH 1/9] libdiskfs: set the default sync interval to 30 seconds, (continued)
- [PATCH 4/9] exec: abbreviate the task name if necessary, Justus Winter, 2014/04/28
- [PATCH 5/9] ext2fs: fix type of inum, Justus Winter, 2014/04/28
- Re: [PATCH 5/9] ext2fs: fix type of inum,
Samuel Thibault <=
- [PATCH 7/9] ext2fs: use two distinct pager buckets for the disk and file pager, Justus Winter, 2014/04/28
- [PATCH 9/9] libpager: remove all the unused seqno parameters, Justus Winter, 2014/04/28
- [PATCH 6/9] ext2fs: simplify expression, Justus Winter, 2014/04/28
- [PATCH 8/9] libpager: make libpager single-threaded, Justus Winter, 2014/04/28
- Re: let's make libpager single-threaded, Richard Braun, 2014/04/28