Re: [PATCH][BUG] ext4: do not execute ext4_std_error with EFBIG at ext4_setattr

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

 



Toshiyuki Okajima wrote:
> From: Toshiyuki Okajima <toshi.okajima@xxxxxxxxxxxxxx>
> 
> You know, do_truncate() can call ext4_setattr() (via notify_change()).
> And, ext4_setattr() can return with -EFBIG if the argument(length) of 
> do_truncate() is more than sbi->s_bitmap_maxbytes. At that time, 
> it also calls ext4_std_error() with -EFBIG.
> 
> Besides, a panic happens when ext4_setattr() returns with -EFBIG
> after we mount an ext4 filesystem with errors=panic.

...

> This changes prevent this problem from happening.

Whoops, that one was my fault; thanks for catching it.

I might just "return error" at that spot, but this works fine too.

Reviewed-by: Eric Sandeen <sandeen@xxxxxxxxxx>
 
> Signed-off-by: Toshiyuki Okajima <toshi.okajima@xxxxxxxxxxxxxx>
> ---
>  fs/ext4/inode.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index 42272d6..e87bb45 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -5485,7 +5485,7 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
>  
>  			if (attr->ia_size > sbi->s_bitmap_maxbytes) {
>  				error = -EFBIG;
> -				goto err_out;
> +				goto err_out2;
>  			}
>  		}
>  	}
> @@ -5544,6 +5544,7 @@ err_out:
>  	ext4_std_error(inode->i_sb, error);
>  	if (!error)
>  		error = rc;
> +err_out2:
>  	return error;
>  }
>  

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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