From patchwork Sat Feb 28 17:59:02 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 9388 Received: from lists.samba.org (mail.samba.org [66.70.73.150]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n1SHxtKM018022 for ; Sat, 28 Feb 2009 17:59:55 GMT Received: from dp.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id D0F86163C41 for ; Sat, 28 Feb 2009 17:59:41 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on dp.samba.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.8 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.1.7 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org Received: from mx2.redhat.com (mx2.redhat.com [66.187.237.31]) by lists.samba.org (Postfix) with ESMTP id C1F79163BBB for ; Sat, 28 Feb 2009 17:58:56 +0000 (GMT) Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n1SHx6k6020765; Sat, 28 Feb 2009 12:59:06 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n1SHx6f0015704; Sat, 28 Feb 2009 12:59:07 -0500 Received: from dantu.rdu.redhat.com (dantu.rdu.redhat.com [10.11.228.66]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n1SHx6kZ008534; Sat, 28 Feb 2009 12:59:06 -0500 Received: from dantu.rdu.redhat.com ([127.0.0.1]) by dantu.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n1SHx5mN022586; Sat, 28 Feb 2009 12:59:05 -0500 Received: (from jlayton@localhost) by dantu.rdu.redhat.com (8.13.8/8.13.8/Submit) id n1SHx3hW022585; Sat, 28 Feb 2009 12:59:03 -0500 From: Jeff Layton To: linux-cifs-client@lists.samba.org Date: Sat, 28 Feb 2009 12:59:02 -0500 Message-Id: <1235843943-22563-1-git-send-email-jlayton@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Cc: smfrench@gmail.com Subject: [linux-cifs-client] [PATCH] cifs: set SYNCHRONIZE bit when opening for cifs_rename_pending_delete X-BeenThere: linux-cifs-client@lists.samba.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: The Linux CIFS VFS client List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-cifs-client-bounces+patchwork-cifs-client=patchwork.kernel.org@lists.samba.org Errors-To: linux-cifs-client-bounces+patchwork-cifs-client=patchwork.kernel.org@lists.samba.org From: Jeff Layton Discovered at Connectathon 2009... Some servers apparently require that the filehandle passed to a trans2 rename be opened with the SYNCHRONIZE bit set. If it isn't then the server may throw back an error. This patch makes the cifs-capable connectathon tests pass when run against BlueArc servers. I've also heard rumors that Win2k requires that the file be opened with this bit set as well, but I haven't confirmed it. Signed-off-by: Jeff Layton --- fs/cifs/inode.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 050552c..a80d86d 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -872,8 +872,9 @@ cifs_rename_pending_delete(char *full_path, struct dentry *dentry, int xid) FILE_BASIC_INFO *info_buf = NULL; rc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN, - DELETE|FILE_WRITE_ATTRIBUTES, CREATE_NOT_DIR, - &netfid, &oplock, NULL, cifs_sb->local_nls, + DELETE|FILE_WRITE_ATTRIBUTES|SYNCHRONIZE, + CREATE_NOT_DIR, &netfid, &oplock, NULL, + cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); if (rc != 0) goto out; @@ -1349,7 +1350,7 @@ cifs_do_rename(int xid, struct dentry *from_dentry, const char *fromPath, return rc; /* open the file to be renamed -- we need DELETE perms */ - rc = CIFSSMBOpen(xid, pTcon, fromPath, FILE_OPEN, DELETE, + rc = CIFSSMBOpen(xid, pTcon, fromPath, FILE_OPEN, DELETE|SYNCHRONIZE, CREATE_NOT_DIR, &srcfid, &oplock, NULL, cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);