From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761001AbZBDTGr (ORCPT ); Wed, 4 Feb 2009 14:06:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761465AbZBDStt (ORCPT ); Wed, 4 Feb 2009 13:49:49 -0500 Received: from kroah.org ([198.145.64.141]:33018 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1761362AbZBDStj (ORCPT ); Wed, 4 Feb 2009 13:49:39 -0500 Date: Wed, 4 Feb 2009 10:47:06 -0800 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , Willy Tarreau , Rodrigo Rubira Branco , Jake Edge , Eugene Teo , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Jeff Layton , David Teigland Subject: [patch 39/41] dlm: initialize file_lock struct in GETLK before copying conflicting lock Message-ID: <20090204184706.GN25246@kroah.com> References: <20090204184029.881610776@mini.kroah.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="dlm-initialize-file_lock-struct-in-getlk-before-copying-conflicting-lock.patch" In-Reply-To: <20090204184539.GA25246@kroah.com> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2.6.27-stable review patch. If anyone has any objections, please let us know. ------------------ From: Jeff Layton commit 20d5a39929232a715f29e6cb7e3f0d0c790f41eb upstream. dlm_posix_get fills out the relevant fields in the file_lock before returning when there is a lock conflict, but doesn't clean out any of the other fields in the file_lock. When nfsd does a NFSv4 lockt call, it sets the fl_lmops to nfsd_posix_mng_ops before calling the lower fs. When the lock comes back after testing a lock on GFS2, it still has that field set. This confuses nfsd into thinking that the file_lock is a nfsd4 lock. Fix this by making DLM reinitialize the file_lock before copying the fields from the conflicting lock. Signed-off-by: Jeff Layton Signed-off-by: David Teigland Signed-off-by: Greg Kroah-Hartman --- fs/dlm/plock.c | 2 ++ 1 file changed, 2 insertions(+) --- a/fs/dlm/plock.c +++ b/fs/dlm/plock.c @@ -304,7 +304,9 @@ int dlm_posix_get(dlm_lockspace_t *locks if (rv == -ENOENT) rv = 0; else if (rv > 0) { + locks_init_lock(fl); fl->fl_type = (op->info.ex) ? F_WRLCK : F_RDLCK; + fl->fl_flags = FL_POSIX; fl->fl_pid = op->info.pid; fl->fl_start = op->info.start; fl->fl_end = op->info.end;