RE: [PATCH v2] ceph: fix memory leak in ceph_mds_auth_match()

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

 



On Wed, 2025-01-15 at 20:49 +0100, Ilya Dryomov wrote:
> On Wed, Jan 15, 2025 at 6:49 PM Viacheslav Dubeyko
> <Slava.Dubeyko@xxxxxxx> wrote:
> > 
> 

<skipped>

> Hi Antoine, Slava,
> 
> I have a slight nit that
> 
>     if (first != _tpath) {
>             rc = 0;
>     }
> 
>     if (tlen > len && _tpath[len] != '/') {
>             rc = 0;
>     }
> 
> isn't the exact equivalent of the previous
> 
>     if (first != _tpath) {
>             ...
>             return 0;
>     }
> 
>     if (tlen > len && _tpath[len] != '/') {
>             ...
>             return 0;
>     }
> 
> logic.  I think
> 
>     if (first != _tpath ||
>         (tlen > len && _tpath[len] != '/')) {
>             rc = 0;
>     }
> 
> would be better and a tiny bit more efficient.  Also, renaming rc to
> path_matched and making it a bool for consistency with gid_matched in
> the first half of the function seems worth it.
> 

Yeah, that's right. I have missed this point. Looks better.

Thanks,
Slava.





[Index of Archives]     [CEPH Users]     [Ceph Large]     [Ceph Dev]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux