On Wed, Apr 29, 2015 at 12:57:28PM +1000, NeilBrown wrote: > In any case, holding a mutex while waiting for an upcall is probably a bad > idea. We should try to find a way to work around that... Yeah, it sounds fragile even if we could fix this particular issue in mountd. > Any ideas Bruce ?-) Looking at nfsd_buffered_readdir(): /* * Various filldir functions may end up calling back into * lookup_one_len() and the file system's ->lookup() method. * These expect i_mutex to be held, as it would within readdir. */ host_err = mutex_lock_killable(&dir_inode->i_mutex); and as far as I can tell Kinglong's approach (adding an unlock and lock around nfsd_cross_mnt() calls might actually be OK. Though in general I expect lock() ...code... unlock() to mark a critical section and would be unpleasantly surprised to discover that a function somewhere in the middle had a buried unlock/lock pair. Maybe drop the locking from nfsd_buffered_readdir and *just* take the i_mutex around lookup_one_len(), if that's the only place we need it? --b. -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html