Re: [PATCH v5 3/3] locks: allow support for write delegation

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

 




> On May 24, 2023, at 12:55 PM, Jeff Layton <jlayton@xxxxxxxxxx> wrote:
> 
> On Wed, 2023-05-24 at 15:09 +0000, Chuck Lever III wrote:
>> 
>>> On May 24, 2023, at 11:08 AM, Jeff Layton <jlayton@xxxxxxxxxx> wrote:
>>> 
>>> On Mon, 2023-05-22 at 16:52 -0700, Dai Ngo wrote:
>>>> Remove the check for F_WRLCK in generic_add_lease to allow file_lock
>>>> to be used for write delegation.
>>>> 
>>>> First consumer is NFSD.
>>>> 
>>>> Signed-off-by: Dai Ngo <dai.ngo@xxxxxxxxxx>
>>>> ---
>>>> fs/locks.c | 7 -------
>>>> 1 file changed, 7 deletions(-)
>>>> 
>>>> diff --git a/fs/locks.c b/fs/locks.c
>>>> index df8b26a42524..08fb0b4fd4f8 100644
>>>> --- a/fs/locks.c
>>>> +++ b/fs/locks.c
>>>> @@ -1729,13 +1729,6 @@ generic_add_lease(struct file *filp, long arg, struct file_lock **flp, void **pr
>>>> if (is_deleg && !inode_trylock(inode))
>>>> return -EAGAIN;
>>>> 
>>>> - if (is_deleg && arg == F_WRLCK) {
>>>> - /* Write delegations are not currently supported: */
>>>> - inode_unlock(inode);
>>>> - WARN_ON_ONCE(1);
>>>> - return -EINVAL;
>>>> - }
>>>> -
>>>> percpu_down_read(&file_rwsem);
>>>> spin_lock(&ctx->flc_lock);
>>>> time_out_leases(inode, &dispose);
>>> 
>>> I'd probably move this back to the first patch in the series.
>>> 
>>> Reviewed-by: Jeff Layton <jlayton@xxxxxxxxxx>
>> 
>> I asked him to move it to the end. Is it safe to take out this
>> check before write delegation is actually implemented?
>> 
> 
> I think so, but it don't think it doesn't make much difference either
> way. The only real downside of putting it at the end is that you might
> have to contend with a WARN_ON_ONCE if you're bisecting.

My main concern is in fact preventing problems during bisection.
I can apply 3/3 and then 1/3, if you're good with that.


--
Chuck Lever






[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux