2011-06-24 08:41:45

by Yongqiang Yang

[permalink] [raw]
Subject: Do we really need parallel resizer?

Hi Andreas,

I noticed that resize is protected by resize_lock. Then parallel
resizer works. However, I think there is no need to make parallel
resizer work.

I think we can use an atomic integer 'resize_flag' instead of
resize_lock, resize_flag is set to 1 before the kernel does resizing
work, while resize_flag is set to 0 after the kernel finishes
resizing work. Resizing is allowed only if resize_flag is 0. If
resize_flag is 1, kernel returns -EBUSY to userspace.

What about your opinion?

Yongqiang.

--
Best Wishes
Yongqiang Yang


2011-06-25 02:17:50

by Yongqiang Yang

[permalink] [raw]
Subject: Re: Do we really need parallel resizer?

On Fri, Jun 24, 2011 at 4:41 PM, Yongqiang Yang <[email protected]> wrote:
> Hi Andreas,
>
> I noticed that resize is protected by resize_lock. ?Then parallel
> resizer works. ?However, I think there is no need to make parallel
> resizer work.
>
> I think we can use an atomic integer 'resize_flag' instead of
> resize_lock, ?resize_flag is set to 1 before the kernel does resizing
> work, ?while resize_flag is set to 0 after the kernel finishes
> resizing work. ?Resizing is allowed only if resize_flag is 0. ?If
> resize_flag is 1, kernel returns -EBUSY to userspace.
Sorry, I made an error. we should use an integer protected by resize_lock.

Yongqiang.
>
> What about your opinion?
>
> Yongqiang.
>
> --
> Best Wishes
> Yongqiang Yang
>



--
Best Wishes
Yongqiang Yang

2011-06-25 16:42:34

by Andreas Dilger

[permalink] [raw]
Subject: Re: Do we really need parallel resizer?

I don't care particularly about parallel resize being a common usage. My only concern is to prevent filesystem corruption in case it happens by accident.

I'm not sure why you think it is better to have a flag to indicate resize in progress instead of just having a lock.

If you could please explain the benefit of this then it is possible to make a decision on why this code should be changed.

Cheers, Andreas

On 2011-06-24, at 8:17 PM, Yongqiang Yang <[email protected]> wrote:

> On Fri, Jun 24, 2011 at 4:41 PM, Yongqiang Yang <[email protected]> wrote:
>> Hi Andreas,
>>
>> I noticed that resize is protected by resize_lock. Then parallel
>> resizer works. However, I think there is no need to make parallel
>> resizer work.
>>
>> I think we can use an atomic integer 'resize_flag' instead of
>> resize_lock, resize_flag is set to 1 before the kernel does resizing
>> work, while resize_flag is set to 0 after the kernel finishes
>> resizing work. Resizing is allowed only if resize_flag is 0. If
>> resize_flag is 1, kernel returns -EBUSY to userspace.
> Sorry, I made an error. we should use an integer protected by resize_lock.
>
> Yongqiang.
>>
>> What about your opinion?
>>
>> Yongqiang.
>>
>> --
>> Best Wishes
>> Yongqiang Yang
>>
>
>
>
> --
> Best Wishes
> Yongqiang Yang