Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4808948yba; Tue, 30 Apr 2019 04:52:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxARR1rdZxMtXbnU3drCP/77aeJcapjSUw7JG+8RI7rtA5edeFAYWdGvalnSLBJUHhCbNPY X-Received: by 2002:a62:528b:: with SMTP id g133mr24604585pfb.246.1556625129036; Tue, 30 Apr 2019 04:52:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556625129; cv=none; d=google.com; s=arc-20160816; b=n7+J6iufuuOOyHhYuxz5B5I7JUqLJehtOAeT1wsjht0s6k7/s60yeIdRGojtDYedLJ hQfcQY88H6UkipYYkjXYz9gnZGkANf8w2ARjxPl1UiKKfZn4AM5dqXEaP0P8q0qbGxBk X9B+eMpLY3z8Aix2vUqfGW3zGTeNSWMsNA8gc7k0CgSz0l8jcRd6aRcMw+mSCdyLW4yc sYJIVYyVDqTr6i0GSeXk9U52+1ZBzevIcCbSh/nLwBgCpWQCWmYyq7TlJjkAqLbnRT1z RB8ATpHjMC0OJvmVgXqzqVYbGBYLy0yrhCDCf8yt1G3gy4YMC0apFvScxz0jNPAVNByh 7gvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yOOxvTpXpv7qMZDQ26IN8q9lb5LtakV2mF+VnDHiTlw=; b=qNDvn1ylJLBGAvzqUZRQzMMrvdQaTg0SkqRXdOmkQx1CE7tCL2EEAckB5ZwhlnUJOO fQKsLcHw2Y/wwBzmKRguYVnfmegycceQNK5DC/ny+gL04XTr7F7TCFMpWC8gkxYQGthe bfE3/EbkmD96CSTnZSLzff/vktTwfValVw4xjDfEH9oUYa4sJ63Ur747VLzNEruNqQ6K P7qULcGt1m37GT4gnX/R0PsWyAygboAj0V7VCsV42Weo87qNn9dGISZau3cFrdzGLcat A7IpVpKFRkl1BX+4u0ChmRMOOBoRWnRYHSuItr4x5uE5c8vGSI9M6wF8yNpQxRgnjPP5 LBYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=T2PTzaOE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si11736589pgj.491.2019.04.30.04.51.53; Tue, 30 Apr 2019 04:52:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=T2PTzaOE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730947AbfD3LtH (ORCPT + 99 others); Tue, 30 Apr 2019 07:49:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:35488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730934AbfD3LtF (ORCPT ); Tue, 30 Apr 2019 07:49:05 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EE31D20449; Tue, 30 Apr 2019 11:49:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556624944; bh=pshKlxxplvR1pLAnd9ve0f3N039W3du/cqrQvApkfX0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T2PTzaOEDoHO9Iv9Ufa+moWLRGaICiFtZxhsJGcBYYTwVXYcsGRedO04sEaV2i365 sQn6J9LRnnIvPK6YWjsBmoQHXLmNgPmeRb0pO+fJZGug34kzM3lh+RfWeRlGkruUxt 4+sZrfFCYrNJlxABm5gS8Pq8kPAgCTbdQidx6UIg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Slawomir Pryczek , Neil Brown , Jeff Layton , "J. Bruce Fields" Subject: [PATCH 5.0 31/89] nfsd: wake waiters blocked on file_lock before deleting it Date: Tue, 30 Apr 2019 13:38:22 +0200 Message-Id: <20190430113611.383864519@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190430113609.741196396@linuxfoundation.org> References: <20190430113609.741196396@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeff Layton commit 6aaafc43a4ecc5bc8a3f6a2811d5eddc996a97f3 upstream. After a blocked nfsd file_lock request is deleted, knfsd will send a callback to the client and then free the request. Commit 16306a61d3b7 ("fs/locks: always delete_block after waiting.") changed it such that locks_delete_block is always called on a request after it is awoken, but that patch missed fixing up blocked nfsd request handling. Call locks_delete_block on the block to wake up any locks still blocked on the nfsd lock request before freeing it. Some of its callers already do this however, so just remove those calls. URL: https://bugzilla.kernel.org/show_bug.cgi?id=203363 Fixes: 16306a61d3b7 ("fs/locks: always delete_block after waiting.") Reported-by: Slawomir Pryczek Cc: Neil Brown Cc: stable@vger.kernel.org Signed-off-by: Jeff Layton Signed-off-by: J. Bruce Fields Signed-off-by: Greg Kroah-Hartman --- fs/nfsd/nfs4state.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -265,6 +265,7 @@ find_or_allocate_block(struct nfs4_locko static void free_blocked_lock(struct nfsd4_blocked_lock *nbl) { + locks_delete_block(&nbl->nbl_lock); locks_release_private(&nbl->nbl_lock); kfree(nbl); } @@ -293,7 +294,6 @@ remove_blocked_locks(struct nfs4_lockown nbl = list_first_entry(&reaplist, struct nfsd4_blocked_lock, nbl_lru); list_del_init(&nbl->nbl_lru); - locks_delete_block(&nbl->nbl_lock); free_blocked_lock(nbl); } } @@ -4863,7 +4863,6 @@ nfs4_laundromat(struct nfsd_net *nn) nbl = list_first_entry(&reaplist, struct nfsd4_blocked_lock, nbl_lru); list_del_init(&nbl->nbl_lru); - locks_delete_block(&nbl->nbl_lock); free_blocked_lock(nbl); } out: