From mboxrd@z Thu Jan 1 00:00:00 1970 From: akpm@linux-foundation.org Subject: - nfs-infinite-loop-in-fcntlf_setlkw.patch removed from -mm tree Date: Thu, 10 Apr 2008 14:36:24 -0700 Message-ID: <200804102136.m3ALaOh2018592@imap1.linux-foundation.org> Reply-To: linux-kernel@vger.kernel.org Return-path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:55341 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755116AbYDJVh0 (ORCPT ); Thu, 10 Apr 2008 17:37:26 -0400 Sender: mm-commits-owner@vger.kernel.org List-Id: mm-commits@vger.kernel.org To: miklos@szeredi.hu, bfields@fieldses.org, cel@citi.umich.edu, mszeredi@suse.cz, neilb@suse.de, trond.myklebust@fys.uio.no, mm-commits@vger.kernel.org The patch titled nfs: infinite loop in fcntl(F_SETLKW) has been removed from the -mm tree. Its filename was nfs-infinite-loop-in-fcntlf_setlkw.patch This patch was dropped because an updated version will be merged The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: nfs: infinite loop in fcntl(F_SETLKW) From: Miklos Szeredi Another infinite loop, this one involving both client and server. Basically what happens is that on the server nlm_fopen() calls nfsd_open() which returns -EACCES, to which nlm_fopen() returns NLM_LCK_DENIED. On the client this will turn into a -EAGAIN (nlm_stat_to_errno()), which in will cause fcntl_setlk() to retry forever. I _think_ the solution is to turn NLM_LCK_DENIED into ENOLCK for blocking locks, as NLM_LCK_BLOCKED is for the contended case. For testing the lock leave NLM_LCK_DENIED as EAGAIN. That still could be misleading, but at least there's no infinite loop in that case. I've minimally tested this patch to verify that it cures the lockup, and that simple blocking locks keep working. Signed-off-by: Miklos Szeredi Cc: "J. Bruce Fields" Cc: Trond Myklebust Cc: Neil Brown Cc: Chuck Lever Signed-off-by: Andrew Morton --- fs/lockd/clntproc.c | 3 +++ 1 file changed, 3 insertions(+) diff -puN fs/lockd/clntproc.c~nfs-infinite-loop-in-fcntlf_setlkw fs/lockd/clntproc.c --- a/fs/lockd/clntproc.c~nfs-infinite-loop-in-fcntlf_setlkw +++ a/fs/lockd/clntproc.c @@ -536,6 +536,9 @@ again: up_read(&host->h_rwsem); } status = nlm_stat_to_errno(resp->status); + /* Don't return EAGAIN, as that would make fcntl_setlk() loop */ + if (status == -EAGAIN) + status = -ENOLCK; out_unblock: nlmclnt_finish_block(block); /* Cancel the blocked request if it is still pending */ _ Patches currently in -mm which might be from miklos@szeredi.hu are generic_file_splice_read-fix-lockups.patch git-nfsd.patch nfs-infinite-loop-in-fcntlf_setlkw.patch mmap_region-cleanup-the-final-vma_merge-related-code.patch mm-bdi-move-statistics-to-debugfs.patch add-macros-similar-to-min-max-min_t-max_t.patch fuse-use-clamp-rather-than-nested-min-max.patch notify_change-callers-must-hold-i_mutex.patch