Yea, that sounds like it may be a good fix. Please submit a patch.

 

Frank

 

From: Krishna Harathi [mailto:krishna.harathi@arcserve.com]
Sent: Thursday, May 5, 2022 6:30 PM
To: Frank Filz <ffilzlnx@mindspring.com>; devel@lists.nfs-ganesha.org
Subject: [NFS-Ganesha-Devel] Re: NFS Ganesha in mdcache_avl_qp_lookup_s()

 

We are using 2.5.4 (very old) and planning to upgrade to the latest asap, but will take some time.

 

In the meantime, intend to (a) have an internal fix as shown, hence need feedback if this is reasonable (b) submit a gerrithub patch of the same fix on the latest source.

 

Regards.

Krishna Harathi

 

 

_____________________________________________________________________________________________________________

Krishna Harathi  |  Senior Manager - Engineering
Office: 503.475.5279  |  Mobile: 503.475.5279  |  krishna.harathi@arcserve.com
arcserve.com  |  Twitter  |  LinkedIn  |  YouTube

_____________________________________________________________________________________________________________

If you are not the intended recipient of this message or received it erroneously, please notify the sender and delete it, together with any attachments, and be advised that any dissemination or copying of this message is prohibited.

From: Frank Filz <ffilzlnx@mindspring.com>
Date: Thursday, May 5, 2022 at 7:20 AM
To: Krishna Harathi <krishna.harathi@arcserve.com>, devel@lists.nfs-ganesha.org <devel@lists.nfs-ganesha.org>
Subject: RE: [NFS-Ganesha-Devel] NFS Ganesha in mdcache_avl_qp_lookup_s()

What Ganesha version are you seeing this in? If current, could you submit a gerrithub patch?

 

Thanks

 

Frank

 

From: Krishna Harathi [mailto:krishna.harathi@arcserve.com]
Sent: Wednesday, May 4, 2022 4:14 PM
To: devel@lists.nfs-ganesha.org
Subject: [NFS-Ganesha-Devel] NFS Ganesha in mdcache_avl_qp_lookup_s()

 

Frank,

 

Long time. We are seeing a crash shown below. After seeing the fix in this commit - https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/516675,

I am posting a possible fix.  

 

(gdb) where
#0  0x00000000004f2a34 in avl_dirent_hk_cmpf (lhs=0x2, rhs=0x7f82ebf8b5c8) at ../../../../FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_avl.h:67
#1  0x00000000004f3d48 in avltree_do_lookup (tree=0x7f82d31bbd90, cmp_fn=0x4f2a30 <avl_dirent_hk_cmpf>, is_left=<synthetic pointer>, 
    unbalanced=<synthetic pointer>, pparent=<synthetic pointer>, key=0x7f82ebf8b5c8) at ../../../../include/avltree.h:223
#2  avltree_inline_lookup (cmp_fn=0x4f2a30 <avl_dirent_hk_cmpf>, tree=0x7f82d31bbd90, key=0x7f82ebf8b5c8) at ../../../../include/avltree.h:244
#3  avltree_lookup (tree=0x7f82d31bbd90, key=0x7f82ebf8b5c8) at ../../../../include/avltree.h:252
#4  mdcache_avl_qp_lookup_s (entry=entry@entry=0x7f82d31bb800, name=name@entry=0x7f82c606f440 "meta.tmp", maxj=maxj@entry=1)
    at ../../../../FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_avl.c:779

 

 

Possible fix –

 

diff mdcache_avl.c mdcache_avl.c.new 

760a761,762

>     memset(&v, 0, sizeof(v));

> 

 

I also suggest reviewing all callers of this avltree_lookup() for potential similar problems. Comments?

 

Regards.

Krishna Harathi

 

_____________________________________________________________________________________________________________

Krishna Harathi  |  Senior Manager - Engineering
Office: 503.475.5279  |  Mobile: 503.475.5279  | 
krishna.harathi@arcserve.com
arcserve.com  |  Twitter  |  LinkedIn  |  YouTube

_____________________________________________________________________________________________________________

If you are not the intended recipient of this message or received it erroneously, please notify the sender and delete it, together with any attachments, and be advised that any dissemination or copying of this message is prohibited.