From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756168AbZF1AKY (ORCPT ); Sat, 27 Jun 2009 20:10:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752259AbZF1AKO (ORCPT ); Sat, 27 Jun 2009 20:10:14 -0400 Received: from qw-out-2122.google.com ([74.125.92.24]:46325 "EHLO qw-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751664AbZF1AKM convert rfc822-to-8bit (ORCPT ); Sat, 27 Jun 2009 20:10:12 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=MRFeNt4NbP2zDWZpAc5P9gPppJ4YObyAKit99CQrjwHGzKBrwp2Fth1ipidXVUf2t3 MLIgpVgfSYkudLbquKhnf42KR/Rjk5XbVM34HpOjAywbx8hbKsks3dIWb3DNG79aCQWT ISnNVg+oUUWZkS29BS5UfzGQTWTxYobQZQxqw= MIME-Version: 1.0 In-Reply-To: <1246100695-10344-1-git-send-email-jlayton@redhat.com> References: <1246100695-10344-1-git-send-email-jlayton@redhat.com> Date: Sat, 27 Jun 2009 19:10:14 -0500 Message-ID: <524f69650906271710n663e4f21x106b5deaa81e20c0@mail.gmail.com> Subject: Re: [PATCH] cifs: fix fh_mutex locking in cifs_reopen_file From: Steve French To: Jeff Layton Cc: linux-cifs-client@lists.samba.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Good catch . I have reviewed and merged into cifs-2.6.git. Merge requested for upstream. On Sat, Jun 27, 2009 at 6:04 AM, Jeff Layton wrote: > Fixes a regression caused by commit a6ce4932fbdbcd8f8e8c6df76812014351c32892 > > When this lock was converted to a mutex, the locks were turned into > unlocks and vice-versa. > > Signed-off-by: Jeff Layton > Cc: Stable Tree > --- >  fs/cifs/file.c |   10 +++++----- >  1 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/fs/cifs/file.c b/fs/cifs/file.c > index ebdbe62..97ce4bf 100644 > --- a/fs/cifs/file.c > +++ b/fs/cifs/file.c > @@ -493,9 +493,9 @@ static int cifs_reopen_file(struct file *file, bool can_flush) >                return -EBADF; > >        xid = GetXid(); > -       mutex_unlock(&pCifsFile->fh_mutex); > +       mutex_lock(&pCifsFile->fh_mutex); >        if (!pCifsFile->invalidHandle) { > -               mutex_lock(&pCifsFile->fh_mutex); > +               mutex_unlock(&pCifsFile->fh_mutex); >                rc = 0; >                FreeXid(xid); >                return rc; > @@ -527,7 +527,7 @@ static int cifs_reopen_file(struct file *file, bool can_flush) >        if (full_path == NULL) { >                rc = -ENOMEM; >  reopen_error_exit: > -               mutex_lock(&pCifsFile->fh_mutex); > +               mutex_unlock(&pCifsFile->fh_mutex); >                FreeXid(xid); >                return rc; >        } > @@ -569,14 +569,14 @@ reopen_error_exit: >                         cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & >                                CIFS_MOUNT_MAP_SPECIAL_CHR); >        if (rc) { > -               mutex_lock(&pCifsFile->fh_mutex); > +               mutex_unlock(&pCifsFile->fh_mutex); >                cFYI(1, ("cifs_open returned 0x%x", rc)); >                cFYI(1, ("oplock: %d", oplock)); >        } else { >  reopen_success: >                pCifsFile->netfid = netfid; >                pCifsFile->invalidHandle = false; > -               mutex_lock(&pCifsFile->fh_mutex); > +               mutex_unlock(&pCifsFile->fh_mutex); >                pCifsInode = CIFS_I(inode); >                if (pCifsInode) { >                        if (can_flush) { > -- > 1.6.0.6 > > -- Thanks, Steve