Re: [PATCH 1/4] ext4: fix wrong return value in ext4_read_inode_bitmap()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 18, 2018 at 09:08:29AM +0900, Wang Shilong wrote:
> From: Wang Shilong <wshilong@xxxxxxx>
> 
> The only reason that sb_getblk() could fail is out of memory,
> ext4 codes have returned -ENOMME for all other places except this
> one, let's fix it here too.
> 
> Signed-off-by: Wang Shilong <wshilong@xxxxxxx>
> ---
>  fs/ext4/ialloc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
> index df92e3ec9913..33a2c98ce1ff 100644
> --- a/fs/ext4/ialloc.c
> +++ b/fs/ext4/ialloc.c
> @@ -143,7 +143,7 @@ ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
>  		ext4_error(sb, "Cannot read inode bitmap - "
>  			    "block_group = %u, inode_bitmap = %llu",
>  			    block_group, bitmap_blk);
> -		return ERR_PTR(-EIO);
> +		return ERR_PTR(-ENOMEM);

Uh... yes this can fail due to IO errors.  If __bread_slow calls
submit_bh, waits for the buffer, and the buffer isn't uptodate after the
IO completes, that means that there was an IO error.  It's a little
dorky that we can't distinguish that vs. an actual ENOMEM, but oh well.

--D

>  	}
>  	if (bitmap_uptodate(bh))
>  		goto verify;
> -- 
> 2.14.3
> 



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux