From patchwork Fri Aug 20 19:31:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 120675 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7KJWD0r020102 for ; Fri, 20 Aug 2010 19:32:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753616Ab0HTTcN (ORCPT ); Fri, 20 Aug 2010 15:32:13 -0400 Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.122]:59582 "EHLO cdptpa-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752110Ab0HTTcM (ORCPT ); Fri, 20 Aug 2010 15:32:12 -0400 X-Authority-Analysis: v=1.1 cv=me5rXWH8syBwDNiWqu/2VC2FCgr8XoBc7B0xMnaGAgw= c=1 sm=0 a=OS90KfWKwbAA:10 a=ld/erqUjW76FpBUqCqkKeA==:17 a=20KFwNOVAAAA:8 a=SiXOXdnYAmaPOjxGfsIA:9 a=4uFGlOKe4LnDtDNWgTUA:7 a=dp-C_wpgVHcQ9t067zYulyiCtpMA:4 a=jEp0ucaQiEUA:10 a=ld/erqUjW76FpBUqCqkKeA==:117 X-Cloudmark-Score: 0 X-Originating-IP: 71.70.153.3 Received: from [71.70.153.3] ([71.70.153.3:55290] helo=mail.poochiereds.net) by cdptpa-oedge04.mail.rr.com (envelope-from ) (ecelerity 2.2.2.39 r()) with ESMTP id EE/13-17211-B38DE6C4; Fri, 20 Aug 2010 19:32:11 +0000 Received: by mail.poochiereds.net (Postfix, from userid 4447) id 2D8EA58148; Fri, 20 Aug 2010 15:32:11 -0400 (EDT) From: Jeff Layton To: linux-cifs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org Subject: [PATCH 01/15] cifs: eliminate redundant xdev check in cifs_rename Date: Fri, 20 Aug 2010 15:31:57 -0400 Message-Id: <1282332731-17444-2-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.7.2.1 In-Reply-To: <1282332731-17444-1-git-send-email-jlayton@redhat.com> References: <1282332731-17444-1-git-send-email-jlayton@redhat.com> Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 20 Aug 2010 19:32:14 +0000 (UTC) diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 7eacb10..dd41355 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -1468,29 +1468,18 @@ int cifs_rename(struct inode *source_dir, struct dentry *source_dentry, { char *fromName = NULL; char *toName = NULL; - struct cifs_sb_info *cifs_sb_source; - struct cifs_sb_info *cifs_sb_target; + struct cifs_sb_info *cifs_sb; struct cifsTconInfo *tcon; FILE_UNIX_BASIC_INFO *info_buf_source = NULL; FILE_UNIX_BASIC_INFO *info_buf_target; int xid, rc, tmprc; - cifs_sb_target = CIFS_SB(target_dir->i_sb); - cifs_sb_source = CIFS_SB(source_dir->i_sb); - tcon = cifs_sb_source->tcon; + cifs_sb = CIFS_SB(source_dir->i_sb); + tcon = cifs_sb->tcon; xid = GetXid(); /* - * BB: this might be allowed if same server, but different share. - * Consider adding support for this - */ - if (tcon != cifs_sb_target->tcon) { - rc = -EXDEV; - goto cifs_rename_exit; - } - - /* * we already have the rename sem so we do not need to * grab it again here to protect the path integrity */ @@ -1525,17 +1514,16 @@ int cifs_rename(struct inode *source_dir, struct dentry *source_dentry, info_buf_target = info_buf_source + 1; tmprc = CIFSSMBUnixQPathInfo(xid, tcon, fromName, info_buf_source, - cifs_sb_source->local_nls, - cifs_sb_source->mnt_cifs_flags & + cifs_sb->local_nls, + cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); if (tmprc != 0) goto unlink_target; - tmprc = CIFSSMBUnixQPathInfo(xid, tcon, - toName, info_buf_target, - cifs_sb_target->local_nls, - /* remap based on source sb */ - cifs_sb_source->mnt_cifs_flags & + tmprc = CIFSSMBUnixQPathInfo(xid, tcon, toName, + info_buf_target, + cifs_sb->local_nls, + cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); if (tmprc == 0 && (info_buf_source->UniqueId ==