Re: [PATCH 2/2] cifs: Handle OFD locks

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

 



Hi Pavel,

Thanks for the review!

Pavel Shilovsky <piastryyy@xxxxxxxxx> writes:

> пт, 29 июн. 2018 г. в 14:18, Paulo Alcantara <paulo@xxxxxxxx>:
>>  static bool
>> -cifs_find_fid_lock_conflict(struct cifs_fid_locks *fdlocks, __u64 offset,
>> -                           __u64 length, __u8 type, struct cifsFileInfo *cfile,
>> -                           struct cifsLockInfo **conf_lock, int rw_check)
>> +locks_conflict(struct cifsFileInfo *cfile, struct cifsFileInfo *cur_cfile,
>> +              struct cifsLockInfo *li, __u8 type, unsigned int flags,
>> +              struct TCP_Server_Info *server, int rw_check)
>> +{
>
> This function assumes that locks overlap, so, locks_overlap() check
> should be called here first and __fid_lock_conflicts() should just
> call lock_conflict.

OK - makes sense. I'll do it.

>> +       if (rw_check == CIFS_LOCK_OP) {
>> +               if (!server->ops->compare_fids(cfile, cur_cfile))
>> +                       return true;
>> +               if ((flags & FL_FLOCK) && current->tgid == li->pid)
>> +                       return false;
>> +               if ((flags & FL_OFDLCK) && (li->flags & FL_OFDLCK))
>> +                       return false;
>> +               if (li->type & server->vals->exclusive_lock_type)
>> +                       return true;
>> +               if (type & server->vals->exclusive_lock_type)
>> +                       return true;
>> +               return false;
>> +       }
>> +
>> +       if (server->ops->compare_fids(cfile, cur_cfile) &&
>> +           current->tgid == li->pid &&
>> +           (!(li->type & server->vals->shared_lock_type) ||
>> +            rw_check != CIFS_WRITE_OP))
>
> Please keep the original comment.

OK.

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




[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux