What code base is this on? I'll take a look at the scenario. Frank
> -----Original Message----- > From: Pradeep [mailto:pradeep.tho...@gmail.com] > Sent: Friday, July 28, 2017 7:07 AM > To: nfs-ganesha-devel@lists.sourceforge.net > Subject: [Nfs-ganesha-devel] deadlock between mdcache_rename() and > mdcache_getattrs() > > Hello, > > I seem to be hitting a deadlock in Ganesha mdcache. I have debugged it and > here is what I see on the hung process: > > Thread1 is doing a rename operation. Lets say file1 being moved from 'dir0' > to 'dir1'. This calls mdcache_rename() > - Holds content_lock for both parents - dir0 and dir1 > - In mdcache_refresh_attrs_no_invalidate() on 'dir1' > o Tries to hold attr_lock in write mode [ attr_lock is needed when calling > mdcache_refresh_attrs() ] > > Thread2 is doing a getattr on 'dir1' [ the destination diretory of the > rename]. > This calls mdcache_getattrs(). > - Holds attr_lock in write mode. > - Calls mdcache_refresh_attrs( invalidate=true) > o Tries to hold content_lock in write mode if ‘invalidate’ is needed. > > These two threads ends up in a deadlock and all other threads waiting for > attr_lock in READ mode also are hung. > > To fix this, is it ok to drop content_lock before calling > mdcache_refresh_attrs() in mdcache_rename(). From the locking guidelines, > it appears that mdcache_refresh_attrs() doesn't require content_lock. > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most engaging > tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Nfs-ganesha-devel mailing list > Nfs-ganesha-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Nfs-ganesha-devel mailing list Nfs-ganesha-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel