On Sun, Sep 23, 2012 at 05:54:18PM +0800, Miao Xie wrote:
> >> @@ -2347,7 +2335,8 @@ static int chunk_usage_filter(struct btrfs_fs_info 
> >> *fs_info, u64 chunk_offset,
> >>    cache = btrfs_lookup_block_group(fs_info, chunk_offset);
> >>    chunk_used = btrfs_block_group_used(&cache->item);
> >>  
> >> -  user_thresh = div_factor_fine(cache->key.offset, bargs->usage);
> >> +  BUG_ON(bargs->usage < 0 || bargs->usage > 100);
> > 
> > otherwise it reliably crashes here
> 
> Sorry, I don't know why it will crash here if we input 0. I tried to input 0,
> and it worked well.

My oversight, sorry.

> I think the only case we must take into account is the users might input the 
> wrong value (>100 or <0)
> on the old kernel, and it can be stored into the filesystem. If we mount this 
> filesystem
> on the new kernel, some problems may happen.

So better avoid a BUG_ON.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to